]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
build: no more recursion for lib 'subdir'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 5 May 2013 19:05:43 +0000 (21:05 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 6 May 2013 10:26:37 +0000 (12:26 +0200)
* Makefile.am (SUBDIRS): Drop 'lib'.
(edit): New, shared among the recipes in 'lib/local.mk' and
'bin/local.mk'.
(CLEANFILES): New, will be updated later in included files.
($(srcdir)/lib/local.mk): Include it.
($(srcdir)/lib/freeze.mk): Likewise.
* lib/Makefile.am: Rename ...
* lib/local.mk: .. like this, with several adjustments.  In
particular ...
(edit): Drop this definition, subsumed by the one in the
top-level Makefile.am.
* bin/local.mk (edit): Drop definition, that is already present
in the top-level Makefile.am now.
($(srcdir)/lib/freeze.mk): Drop inclusion; that is already done
in the top-level Makefile.am now.
* doc/local.mk (CLEANFILES): Adjust: append to it, do not define
it.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Adjust recipe.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/Makefile'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Makefile.am
bin/local.mk
configure.ac
doc/local.mk
lib/freeze.mk
lib/local.mk [moved from lib/Makefile.am with 61% similarity]

index 697625e24809b2a5a83df939ca0a07c8cc71626f..c4544bbd7b20b6445a2637445ebdb62a6fb0b1ba 100644 (file)
 
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . lib tests man
+SUBDIRS = . tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
 MOSTLYCLEANFILES =
+CLEANFILES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
             BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -32,6 +33,27 @@ EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
             build-aux/gitlog-to-changelog \
             .prev-version .version
 
+edit = sed \
+       -e 's|@SHELL[@]|$(SHELL)|g' \
+       -e 's|@PERL[@]|$(PERL)|g' \
+       -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
+       -e 's|@bindir[@]|$(bindir)|g' \
+       -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
+       -e 's|@prefix[@]|$(prefix)|g' \
+       -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
+       -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
+       -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
+       -e 's|@M4[@]|$(M4)|g' \
+       -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
+       -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
+       -e 's|@AWK[@]|$(AWK)|g' \
+       -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
+       -e 's|@VERSION[@]|$(VERSION)|g' \
+       -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+       -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
+
+include $(srcdir)/lib/freeze.mk
+
 ## --------- ##
 ## INSTALL.  ##
 ## --------- ##
@@ -105,6 +127,7 @@ distclean-local:
 
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
+include $(srcdir)/lib/local.mk
 
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
index ff7b2cfdbc12148124354827a842ffd88f035963..c4ed17f70843ec99321e7eb2883d022dceddaf7b 100644 (file)
@@ -15,8 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-include $(srcdir)/lib/freeze.mk
-
 bin_SCRIPTS = \
   bin/autoconf \
   bin/autoheader \
@@ -42,25 +40,6 @@ MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 ## The scripts.  ##
 ## ------------- ##
 
-edit = sed \
-       -e 's|@SHELL[@]|$(SHELL)|g' \
-       -e 's|@PERL[@]|$(PERL)|g' \
-       -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
-       -e 's|@bindir[@]|$(bindir)|g' \
-       -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-       -e 's|@prefix[@]|$(prefix)|g' \
-       -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-       -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
-       -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
-       -e 's|@M4[@]|$(M4)|g' \
-       -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
-       -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-       -e 's|@AWK[@]|$(AWK)|g' \
-       -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
-       -e 's|@VERSION[@]|$(VERSION)|g' \
-       -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-       -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
-
 # autoconf is written in M4sh.
 # FIXME: this target should depend on the frozen files below lib/m4sugar,
 # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
index 91f6a74a8d62e12b0c811a54d7c7d70918b7b339..0fa61f4982858658ba89181c651cad44e22ba641 100644 (file)
@@ -211,7 +211,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile lib/Makefile])
+AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.
index 81298ed71e58adf2426830ee73fd029e6707c601..ce55181856dd9590e6cc171b94078f4353de2de9 100644 (file)
@@ -27,7 +27,7 @@ EXTRA_DIST += doc/gendocs_template
 
 # Files from texi2dvi that should be removed, but which Automake does
 # not know.
-CLEANFILES = \
+CLEANFILES += \
   autoconf.ACs \
   autoconf.cvs \
   autoconf.MSs \
index 60d3614b7963517ed5dca7e0671a968d4716f45b..fffc20cdff83acb9694c71ee96eb5a889b4a08d9 100644 (file)
@@ -24,7 +24,7 @@ SUFFIXES = .m4 .m4f
 
 AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
 $(AUTOM4TE_CFG): $(top_srcdir)/lib/autom4te.in
-       cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) lib/autom4te.cfg
 
 # Do not use AUTOM4TE here, since maint.mk (my-distcheck)
 # checks if we are independent of Autoconf by defining AUTOM4TE (and
@@ -43,9 +43,13 @@ MY_AUTOM4TE =                                                                        \
 # force an end of line when reporting errors.
 .m4.m4f:
        $(MKDIR_P) $(@D)
-       $(MY_AUTOM4TE)                          \
-               --language=$(*F)                \
-               --freeze                        \
+       lang=`echo '$*' | sed 's,.*/,,'` \
+         && if test $$lang = autoconf; then \
+              lang=autoconf-without-aclocal-m4; \
+            else :; fi \
+         && $(MY_AUTOM4TE) \
+               --language=$$lang \
+               --freeze \
                --output=$@
 
 # Factor the dependencies between all the frozen files.
similarity index 61%
rename from lib/Makefile.am
rename to lib/local.mk
index 2b4c494dbdf641b8097f76c326b099737f042dea..36ff4845dad6438465bd60e4fd10cd5ec81549d1 100644 (file)
 
 TAGS_FILES = # Incrementally updated later.
 ETAGS_ARGS = # Likewise.
-EXTRA_DIST = # Likewise.
 
-## Required by rules to build several m4 libraries.
-include $(srcdir)/freeze.mk
-
-## Checks.
+# Additional checks.
 check-local: check-forbidden-patterns
 forbidden_patterns = -e '^_*EOF' -e ' cmp '
 forbidden_patterns_files = # Incrementally updated later.
@@ -34,15 +30,15 @@ forbidden_patterns_files = # Incrementally updated later.
 perllibdir = $(pkgdatadir)/Autom4te
 
 dist_perllib_DATA = \
-  Autom4te/C4che.pm \
-  Autom4te/ChannelDefs.pm \
-  Autom4te/Channels.pm \
-  Autom4te/Configure_ac.pm \
-  Autom4te/FileUtils.pm \
-  Autom4te/General.pm \
-  Autom4te/Getopt.pm \
-  Autom4te/Request.pm \
-  Autom4te/XFile.pm
+  lib/Autom4te/C4che.pm \
+  lib/Autom4te/ChannelDefs.pm \
+  lib/Autom4te/Channels.pm \
+  lib/Autom4te/Configure_ac.pm \
+  lib/Autom4te/FileUtils.pm \
+  lib/Autom4te/General.pm \
+  lib/Autom4te/Getopt.pm \
+  lib/Autom4te/Request.pm \
+  lib/Autom4te/XFile.pm
 
 TAGS_FILES += $(dist_perllib_DATA)
 ETAGS_ARGS += --lang=perl
@@ -51,38 +47,25 @@ ETAGS_ARGS += --lang=perl
 ## Make Autom4te default configuration file.  ##
 ## ------------------------------------------ ##
 
-nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST += autom4te.in
-
-edit = sed \
-       -e 's|@SHELL[@]|$(SHELL)|g' \
-       -e 's|@PERL[@]|$(PERL)|g' \
-       -e 's|@bindir[@]|$(bindir)|g' \
-       -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-       -e 's|@prefix[@]|$(prefix)|g' \
-       -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-       -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
-       -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
-       -e 's|@M4[@]|$(M4)|g' \
-       -e 's|@AWK[@]|$(AWK)|g' \
-       -e 's|@VERSION[@]|$(VERSION)|g' \
-       -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g'
+nodist_pkgdata_DATA = lib/autom4te.cfg
+EXTRA_DIST += lib/autom4te.in
 
 # All the files below depend on Makefile so that they are rebuilt
 # when the prefix, etc. changes. Unfortunately, suffix rules
 # cannot have additional dependencies, so we have to use explicit rules.
-CLEANFILES = autom4te.cfg
-autom4te.cfg: $(srcdir)/autom4te.in Makefile
-       rm -f autom4te.cfg autom4te.tmp
-       $(edit) $(srcdir)/autom4te.in >autom4te.tmp
-       chmod a-w autom4te.tmp
-       mv autom4te.tmp autom4te.cfg
+CLEANFILES += lib/autom4te.cfg
+lib/autom4te.cfg: $(srcdir)/lib/autom4te.in Makefile
+       rm -f $@ $@-t
+       $(MKDIR_P) $(@D)
+       $(edit) $(srcdir)/lib/autom4te.in >$@-t
+       chmod a-w $@-t
+       mv -f $@-t $@
 
 ## ----------------------------- ##
 ## Make Autoconf Emacs library.  ##
 ## ----------------------------- ##
 
-dist_lisp_LISP = emacs/autoconf-mode.el emacs/autotest-mode.el
+dist_lisp_LISP = lib/emacs/autoconf-mode.el lib/emacs/autotest-mode.el
 
 # TODO: This is required to work around a limitation in older
 #      Automake.  Remove once we can assume Automake 1.13 or later.
@@ -95,27 +78,27 @@ CLEANFILES += autoconf-mode.elc autotest-mode.elc
 autoconflibdir = $(pkgdatadir)/autoconf
 
 dist_autoconflib_DATA = \
-  autoconf/autoconf.m4 \
-  autoconf/general.m4 \
-  autoconf/status.m4 \
-  autoconf/oldnames.m4 \
-  autoconf/specific.m4 \
-  autoconf/autoheader.m4 \
-  autoconf/autoupdate.m4 \
-  autoconf/autotest.m4 \
-  autoconf/autoscan.m4 \
-  autoconf/lang.m4 \
-  autoconf/c.m4 \
-  autoconf/erlang.m4 \
-  autoconf/fortran.m4 \
-  autoconf/functions.m4 \
-  autoconf/go.m4 \
-  autoconf/headers.m4 \
-  autoconf/types.m4 \
-  autoconf/libs.m4 \
-  autoconf/programs.m4
-
-nodist_autoconflib_DATA = autoconf/autoconf.m4f
+  lib/autoconf/autoconf.m4 \
+  lib/autoconf/general.m4 \
+  lib/autoconf/status.m4 \
+  lib/autoconf/oldnames.m4 \
+  lib/autoconf/specific.m4 \
+  lib/autoconf/autoheader.m4 \
+  lib/autoconf/autoupdate.m4 \
+  lib/autoconf/autotest.m4 \
+  lib/autoconf/autoscan.m4 \
+  lib/autoconf/lang.m4 \
+  lib/autoconf/c.m4 \
+  lib/autoconf/erlang.m4 \
+  lib/autoconf/fortran.m4 \
+  lib/autoconf/functions.m4 \
+  lib/autoconf/go.m4 \
+  lib/autoconf/headers.m4 \
+  lib/autoconf/types.m4 \
+  lib/autoconf/libs.m4 \
+  lib/autoconf/programs.m4
+
+nodist_autoconflib_DATA = lib/autoconf/autoconf.m4f
 CLEANFILES += $(nodist_autoconflib_DATA)
 
 TAGS_FILES += $(dist_autoconflib_DATA)
@@ -123,7 +106,7 @@ ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autoconflib_DATA)
 
-autoconf/autoconf.m4f: $(autoconf_m4f_dependencies)
+lib/autoconf/autoconf.m4f: $(autoconf_m4f_dependencies)
 
 ## ------------------------ ##
 ##  Make Autoscan library.  ##
@@ -131,19 +114,22 @@ autoconf/autoconf.m4f: $(autoconf_m4f_dependencies)
 
 autoscanlibdir = $(pkgdatadir)/autoscan
 
-EXTRA_DIST += autoscan/autoscan.pre
-nodist_autoscanlib_DATA = autoscan/autoscan.list
-CLEANFILES += autoscan/autoscan.list
+EXTRA_DIST += lib/autoscan/autoscan.pre
+nodist_autoscanlib_DATA = lib/autoscan/autoscan.list
+CLEANFILES += lib/autoscan/autoscan.list
 
-autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre $(autoconf_m4f_dependencies) Makefile.am
+lib/autoscan/autoscan.list: $(srcdir)/lib/autoscan/autoscan.pre
        $(MKDIR_P) $(@D)
        echo '# Automatically Generated: do not edit this file' >$@
-       sed '/^[#]/!q' $(srcdir)/autoscan/autoscan.pre >>$@
+       sed '/^[#]/!q' $(srcdir)/lib/autoscan/autoscan.pre >>$@
        ( \
-         sed -n '/^[^#]/p' $(srcdir)/autoscan/autoscan.pre; \
-         $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2                $$3' \
+         sed -n '/^[^#]/p' $(srcdir)/lib/autoscan/autoscan.pre; \
+         $(MY_AUTOM4TE) --cache '' -M -l autoconf-without-aclocal-m4 \
+                        -t'AN_OUTPUT:$$1: $$2          $$3' \
        ) | LC_ALL=C sort >>$@
 
+lib/autoscan/autoscan.list: $(autoconf_m4f_dependencies) Makefile
+
 ## ----------------------------------- ##
 ## Make Autoconf library for M4sugar.  ##
 ## ----------------------------------- ##
@@ -151,20 +137,20 @@ autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre $(autoconf_m4f_dependenc
 m4sugarlibdir = $(pkgdatadir)/m4sugar
 
 dist_m4sugarlib_DATA = \
-  m4sugar/m4sugar.m4 \
-  m4sugar/foreach.m4 \
-  m4sugar/m4sh.m4
+  lib/m4sugar/m4sugar.m4 \
+  lib/m4sugar/foreach.m4 \
+  lib/m4sugar/m4sh.m4
 
 nodist_m4sugarlib_DATA = \
-  m4sugar/version.m4 \
-  m4sugar/m4sugar.m4f \
-  m4sugar/m4sh.m4f
+  lib/m4sugar/version.m4 \
+  lib/m4sugar/m4sugar.m4f \
+  lib/m4sugar/m4sh.m4f
 
 CLEANFILES += $(nodist_m4sugarlib_DATA)
 
 # The ':;' in the second line of the recipe works around a redirected
 # compound command bash exit status bug.
-m4sugar/version.m4: Makefile
+lib/m4sugar/version.m4: Makefile
        $(MKDIR_P) $(@D)
        :;{ \
          echo '# This file is part of -*- Autoconf -*-.' && \
@@ -187,8 +173,8 @@ ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_m4sugarlib_DATA)
 
-m4sugar/m4sugar.m4f: $(m4sugar_m4f_dependencies)
-m4sugar/m4sh.m4f: $(m4sh_m4f_dependencies)
+lib/m4sugar/m4sugar.m4f: $(m4sugar_m4f_dependencies)
+lib/m4sugar/m4sh.m4f: $(m4sh_m4f_dependencies)
 
 ## ----------------------- ##
 ## Make Autotest library.  ##
@@ -197,11 +183,11 @@ m4sugar/m4sh.m4f: $(m4sh_m4f_dependencies)
 autotestlibdir = $(pkgdatadir)/autotest
 
 dist_autotestlib_DATA = \
-  autotest/autotest.m4 \
-  autotest/general.m4 \
-  autotest/specific.m4
+  lib/autotest/autotest.m4 \
+  lib/autotest/general.m4 \
+  lib/autotest/specific.m4
 
-nodist_autotestlib_DATA = autotest/autotest.m4f
+nodist_autotestlib_DATA = lib/autotest/autotest.m4f
 CLEANFILES += $(nodist_autotestlib_DATA)
 
 TAGS_FILES += $(dist_autotestlib_DATA)
@@ -209,4 +195,4 @@ ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autotestlib_DATA)
 
-autotest/autotest.m4f: $(autotest_m4f_dependencies)
+lib/autotest/autotest.m4f: $(autotest_m4f_dependencies)