]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
build: no more make recursion for 'bin' subdir
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 5 May 2013 14:40:10 +0000 (16:40 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 6 May 2013 10:22:10 +0000 (12:22 +0200)
* Makefile.am (MOSTLYCLEANFILES): New, to be extended later by
included files.
($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'bin'.  Adjust comments.
* bin/Makefile.am: Rename ...
* bin/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'bin/Makefile'.

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

index 757d8bce79c7bdc7c867ca6d7443f5526f9df4a5..697625e24809b2a5a83df939ca0a07c8cc71626f 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# bin/ must be run first, as it builds executables needed for tests.
 # 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 = bin . lib tests man
+SUBDIRS = . lib tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
+MOSTLYCLEANFILES =
+
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
             BUGS COPYINGv3 COPYING.EXCEPTION \
             GNUmakefile maint.mk cfg.mk \
@@ -102,6 +103,7 @@ dist-hook: gen-ChangeLog
 distclean-local:
        if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
 
+include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 
 # Perl coverage statistics.
similarity index 72%
rename from bin/Makefile.am
rename to bin/local.mk
index fd264ab0cde0777d1e6f253f31e1c07b7a5d1e64..57983f82cdd3bdab5d3dbad1c8b29d84446f7f2e 100644 (file)
 # 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 ../lib/freeze.mk
-
-bin_SCRIPTS = autom4te \
-             autoconf autoheader autoreconf ifnames autoscan autoupdate
-
-EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
-            autoscan.in autom4te.in
+include $(srcdir)/lib/freeze.mk
+
+bin_SCRIPTS = \
+  bin/autoconf \
+  bin/autoheader \
+  bin/autom4te \
+  bin/autoreconf \
+  bin/autoscan \
+  bin/autoupdate \
+  bin/ifnames
+
+EXTRA_DIST += \
+  bin/autoconf.as \
+  bin/autoheader.in \
+  bin/autom4te.in \
+  bin/autoreconf.in \
+  bin/autoscan.in \
+  bin/autoupdate.in \
+  bin/ifnames.in
 
 # Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
+MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 
-# Get the release year from ../ChangeLog.
+# Get the release year from ChangeLog.
 RELEASE_YEAR = \
   `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
 
@@ -53,14 +65,13 @@ edit = sed \
        -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
        -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
 
-$(top_builddir)/bin/autom4te: autom4te
-
 # 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
 # installation below the same $(prefix); work around this with --melt.
-autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
-       $(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as -o $@
+bin/autoconf.in: $(srcdir)/bin/autoconf.as $(m4sh_m4f_dependencies)
+       $(MY_AUTOM4TE) --language M4sh --cache '' \
+                      --melt $(srcdir)/bin/autoconf.as -o $@
 
 ## All the scripts depend on Makefile so that they are rebuilt when the
 ## prefix etc. changes.  It took quite a while to have the rule correct,
@@ -68,6 +79,7 @@ autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
 ## Use chmod -w to prevent people from editing the wrong file by accident.
 $(bin_SCRIPTS): Makefile
        rm -f $@ $@.tmp
+       $(MKDIR_P) $(@D)
        srcdir=''; \
          test -f ./$@.in || srcdir=$(srcdir)/; \
          $(edit) $${srcdir}$@.in >$@.tmp
@@ -75,13 +87,13 @@ $(bin_SCRIPTS): Makefile
        chmod a-w $@.tmp
        mv $@.tmp $@
 
-autoconf: autoconf.in
-autoheader: $(srcdir)/autoheader.in
-autom4te: $(srcdir)/autom4te.in
-autoreconf: $(srcdir)/autoreconf.in
-autoscan: $(srcdir)/autoscan.in
-autoupdate: $(srcdir)/autoupdate.in
-ifnames: $(srcdir)/ifnames.in
+bin/autoconf: bin/autoconf.in
+bin/autoheader: $(srcdir)/bin/autoheader.in
+bin/autom4te: $(srcdir)/bin/autom4te.in
+bin/autoreconf: $(srcdir)/bin/autoreconf.in
+bin/autoscan: $(srcdir)/bin/autoscan.in
+bin/autoupdate: $(srcdir)/bin/autoupdate.in
+bin/ifnames: $(srcdir)/bin/ifnames.in
 
 
 ## --------------- ##
@@ -95,9 +107,13 @@ LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
 DIGITS = 0123456789
 WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
 ETAGS_PERL = --lang=perl \
-  autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
-  ifnames.in
+  bin/autoheader.in \
+  bin/autoreconf.in \
+  bin/autoupdate.in \
+  bin/autoscan.in \
+  bin/autom4te.in \
+  bin/ifnames.in
 ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
-  autoconf.in
+  bin/autoconf.in
 
 ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)
index 437206c35f87c6fc7ec80007febcd768faf0c945..1fc00ae4618a32c1596e71f8490eec58bd7172c8 100644 (file)
@@ -211,7 +211,7 @@ AC_CONFIG_FILES([Makefile
                 lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
                 lib/m4sugar/Makefile
                 lib/autoconf/Makefile lib/autotest/Makefile
-                bin/Makefile])
+                ])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.