From bfeef58669d84d5da58f5b20c1f4d476ca2c44e4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 23 Aug 2016 20:53:37 +0200 Subject: [PATCH] buildsystem: don't use recursive make for libs Final step at getting rid of recursive make: convert libs. Signed-off-by: "Yann E. MORIN" --- Makefile.am | 119 +++++++++++++++++++++++++++++++++++++- configure.ac | 4 -- libs/Makefile.am | 7 --- libs/images/Makefile.am | 13 ----- libs/lxdialog/Makefile.am | 15 ----- libs/parser/Makefile.am | 46 --------------- 6 files changed, 118 insertions(+), 86 deletions(-) delete mode 100644 libs/Makefile.am delete mode 100644 libs/images/Makefile.am delete mode 100644 libs/lxdialog/Makefile.am delete mode 100644 libs/parser/Makefile.am diff --git a/Makefile.am b/Makefile.am index 3a786f6..caa18ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,15 @@ ACLOCAL_AMFLAGS = -I scripts/.autostuff/m4 MAKEFLAGS = $(SILENT_MAKEFLAGS) -SUBDIRS = libs EXTRA_DIST = .version bin_PROGRAMS = bin_SCRIPTS = dist_bin_SCRIPTS = +lib_LTLIBRARIES = +noinst_LIBRARIES = + CLEAN_FILES = BUILT_SOURCES = @@ -17,6 +19,121 @@ dist_doc_DATA = \ docs/kconfig-language.txt \ docs/kconfig.txt +#=============================================================================== +# Libraries + +SUFFIXES = .gperf + +lib_LTLIBRARIES += libs/parser/libkconfig-parser.la +libs_parser_libkconfig_parser_la_SOURCES = libs/parser/yconf.y +dist_EXTRA_libs_parser_libkconfig_parser_la_SOURCES = \ + libs/parser/hconf.gperf \ + libs/parser/lconf.l \ + libs/parser/confdata.c \ + libs/parser/menu.c \ + libs/parser/symbol.c \ + libs/parser/util.c \ + libs/parser/expr.c \ + libs/parser/expr.h \ + libs/parser/lkc.h \ + libs/parser/lkc_proto.h +libs_parser_libkconfig_parser_la_CPPFLAGS = \ + -DROOTMENU="\"$(root_menu)\"" \ + -DCONFIG_=\"$(config_prefix)\" \ + $(intl_CPPFLAGS) +libs_parser_libkconfig_parser_la_CFLAGS = \ + $(AM_CFLAGS) \ + $(kf_CFLAGS) +libs_parser_libkconfig_parser_la_LDFLAGS = \ + -release $(KCONFIGPARSER_LIB_VERSION) \ + -no-undefined +libs_parser_libkconfig_parser_la_LIBADD = $(intl_LIBS) + +libs_parser_kconfig_includedir = $(includedir)/kconfig +libs_parser_kconfig_include_HEADERS = \ + libs/parser/list.h \ + libs/parser/lkc.h \ + libs/parser/expr.h \ + libs/parser/lkc_proto.h + +AM_V_GPERF = $(AM_V_GPERF_$(V)) +AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY)) +AM_V_GPERF_0 = @echo " GPERF " $@; + +.gperf.c: + $(AM_V_GPERF)$(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< + +# The following rule produces a warning: +# libs/parser/Makefile.am:41: user target `.l.c' defined here... +# /usr/share/automake-1.11/am/lex.am: ... overrides Automake target +# `.l.c' defined here +# +# This is expected, and can't be avoided (for now). +# That's because, when working with lex+yacc sources, the default is to +# build each files searately, and then link them together into the final +# output. But the Linux kernel's parser simply #include-s the lexer, +# so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES), +# and thus automake does not catch the need to call lex. +# Secondly, when flex is told to change the symbols' prefix (kconfig +# uses zconf in lieue of the original yy), then the output file is +# also renamed, but automake does not now that, and make would fail +# because it would think no file was generated. +.l.c: + $(AM_V_LEX)$(LEXCOMPILE) -o$@ $< + +BUILT_SOURCES += libs/parser/hconf.c libs/parser/lconf.c +CLEAN_FILES += libs/parser/hconf.c libs/parser/lconf.c libs/parser/yconf.c +EXTRA_DIST += libs/parser/yconf.y.patch + +#-------------------------- +# lxdialog lib (for mconf) +if COND_lxdialog + +noinst_LIBRARIES += libs/lxdialog/libkconfig-lxdialog.a + +libs_lxdialog_libkconfig_lxdialog_a_SOURCES = \ + libs/lxdialog/checklist.c \ + libs/lxdialog/dialog.h \ + libs/lxdialog/inputbox.c \ + libs/lxdialog/menubox.c \ + libs/lxdialog/textbox.c \ + libs/lxdialog/util.c \ + libs/lxdialog/yesno.c +libs_lxdialog_libkconfig_lxdialog_a_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(ncurses_mconf_CPPFLAGS) \ + $(intl_CPPFLAGS) +libs_lxdialog_liblxdialog_a_CFLAGS = \ + $(AM_CFLAGS) \ + $(kf_CFLAGS) + +endif # COND_lxdialog + +#-------------------------- +# kconfig meta frontend +if COND_images + +noinst_LIBRARIES += libs/images/libkconfig-images.a + +libs_images_libkconfig_images_a_SOURCES = libs/images/images.c_orig +nodist_libs_images_libkconfig_images_a_SOURCES = libs/images/images.c + +libs/images/images.c: libs/images/images.c_orig + $(AM_V_GEN)$(SED) -e 's/^static //' $< >$@ + +libs/images/images.h: libs/images/images.c_orig + $(AM_V_GEN)$(SED) -e '/^static \(const char \*xpm_\(.\{1,\}\)\[\]\) = {/!d; s//extern \1;/' \ + $< >$@ + +BUILT_SOURCES += \ + libs/images/images.c \ + libs/images/images.h +CLEAN_FILES += \ + libs/images/images.c \ + libs/images/images.h + +endif # COND_images + #=============================================================================== # Frontends diff --git a/configure.ac b/configure.ac index 99705ec..ba7db9b 100644 --- a/configure.ac +++ b/configure.ac @@ -500,10 +500,6 @@ AS_IF( # Finalise AC_CONFIG_FILES([ Makefile - libs/Makefile - libs/images/Makefile - libs/lxdialog/Makefile - libs/parser/Makefile ]) AC_OUTPUT diff --git a/libs/Makefile.am b/libs/Makefile.am deleted file mode 100644 index d4c5973..0000000 --- a/libs/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -if COND_lxdialog - MAYBE_lxdialog = lxdialog -endif -if COND_images - MAYBE_images = images -endif -SUBDIRS = parser $(MAYBE_images) $(MAYBE_lxdialog) diff --git a/libs/images/Makefile.am b/libs/images/Makefile.am deleted file mode 100644 index 009e238..0000000 --- a/libs/images/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -noinst_LIBRARIES = libkconfig-images.a - -libkconfig_images_a_SOURCES = images.c_orig -nodist_libkconfig_images_a_SOURCES = images.c -BUILT_SOURCES = images.c images.h -CLEANFILES = images.c images.h - -images.c: images.c_orig - $(AM_V_GEN)$(SED) -e 's/^static //' $< >$@ - -images.h: images.c_orig - $(AM_V_GEN)$(SED) -e '/^static \(const char \*xpm_\(.\{1,\}\)\[\]\) = {/!d; s//extern \1;/' \ - $< >$@ diff --git a/libs/lxdialog/Makefile.am b/libs/lxdialog/Makefile.am deleted file mode 100644 index a5ba6be..0000000 --- a/libs/lxdialog/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -noinst_LIBRARIES = libkconfig-lxdialog.a - -libkconfig_lxdialog_a_SOURCES = \ - checklist.c \ - dialog.h \ - inputbox.c \ - menubox.c \ - textbox.c \ - util.c \ - yesno.c - -libkconfig_lxdialog_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(ncurses_mconf_CPPFLAGS) \ - $(intl_CPPFLAGS) -liblxdialog_a_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) diff --git a/libs/parser/Makefile.am b/libs/parser/Makefile.am deleted file mode 100644 index d284e6a..0000000 --- a/libs/parser/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -SUFFIXES = .gperf - -lib_LTLIBRARIES = libkconfig-parser.la -libkconfig_parser_la_SOURCES = yconf.y -dist_EXTRA_libkconfig_parser_la_SOURCES = \ - hconf.gperf lconf.l \ - confdata.c menu.c symbol.c util.c \ - expr.c expr.h lkc.h lkc_proto.h -libkconfig_parser_la_CPPFLAGS = -DROOTMENU="\"$(root_menu)\"" \ - -DCONFIG_=\"$(config_prefix)\" \ - $(intl_CPPFLAGS) -libkconfig_parser_la_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) -libkconfig_parser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION) -no-undefined -libkconfig_parser_la_LIBADD = $(intl_LIBS) - -kconfig_includedir = $(includedir)/kconfig -kconfig_include_HEADERS = list.h lkc.h expr.h lkc_proto.h - -BUILT_SOURCES = hconf.c lconf.c -CLEANFILES = hconf.c lconf.c yconf.c -EXTRA_DIST = yconf.y.patch - -AM_V_GPERF = $(AM_V_GPERF_$(V)) -AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY)) -AM_V_GPERF_0 = @echo " GPERF " $@; - -.gperf.c: - $(AM_V_GPERF)$(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< - -# The following rule produces a warning: -# libs/parser/Makefile.am:41: user target `.l.c' defined here... -# /usr/share/automake-1.11/am/lex.am: ... overrides Automake target -# `.l.c' defined here -# -# This is expected, and can't be avoided (for now). -# That's because, when working with lex+yacc sources, the default is to -# build each files searately, and then link them together into the final -# output. But the Linux kernel's parser simply #include-s the lexer, -# so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES), -# and thus automake does not catch the need to call lex. -# Secondly, when flex is told to change the symbols' prefix (kconfig -# uses zconf in lieue of the original yy), then the output file is -# also renamed, but automake does not now that, and make would fail -# because it would think no file was generated. -.l.c: - $(AM_V_LEX)$(LEXCOMPILE) -o$@ $< -- 2.39.5