From: Alexandre Duret-Lutz Date: Thu, 24 Apr 2003 18:33:42 +0000 (+0000) Subject: For automake PR/46: X-Git-Tag: Release-1-7b~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f26c3bba3592b9667052232dacc40056e500900;p=thirdparty%2Fautomake.git For automake PR/46: * lib/am/configure.am (%MAKEFILE-IN%): If Makefile.in is rebuilt because of one of configure's dependencies, run automake without argument to update the whole tree at once. Depend upon %CONFIGURE_DEPS%. (%MAKEFILE%): If Makefile is rebuilt because config.status has been updated, run config.status without arguments. * automake.in (scan_autoconf_traces): Prepend $(top_srcdir) before all files in @configure_deps. * tests/subdir5.test: Modernize configure.in, make sure maude/Makefile was actually created, and exercise %CONFIGURE_DEPS%. * tests/subdir8.test: New file. * tests/Makefile.am (TESTS): Add subdir8.test. (XFAIL_TESTS): Replace subdir5.test by subdir8.test. --- diff --git a/ChangeLog b/ChangeLog index 9bbe0f7f2..17f04c81a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2003-04-24 Akim Demaille + Alexandre Duret-Lutz + + For automake PR/46: + * lib/am/configure.am (%MAKEFILE-IN%): If Makefile.in is rebuilt + because of one of configure's dependencies, run automake without + argument to update the whole tree at once. Depend upon + %CONFIGURE_DEPS%. + (%MAKEFILE%): If Makefile is rebuilt because config.status has + been updated, run config.status without arguments. + * automake.in (scan_autoconf_traces): Prepend $(top_srcdir) + before all files in @configure_deps. + * tests/subdir5.test: Modernize configure.in, make sure + maude/Makefile was actually created, and exercise %CONFIGURE_DEPS%. + * tests/subdir8.test: New file. + * tests/Makefile.am (TESTS): Add subdir8.test. + (XFAIL_TESTS): Replace subdir5.test by subdir8.test. + 2003-04-23 Alexandre Duret-Lutz * automake.texi (Requirements): Typo in index diff --git a/Makefile.in b/Makefile.in index 8ba170fe6..37de4025e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -181,11 +181,27 @@ all: all-recursive am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck diff --git a/automake.in b/automake.in index dd7c55d7a..5a536a84b 100755 --- a/automake.in +++ b/automake.in @@ -5358,7 +5358,7 @@ sub scan_autoconf_traces ($) # m4_include's performed during Autoconf's startup. # Obviously we don't want to distribute Autoconf's files # so we skip absolute filenames here. - push @configure_deps, $args[1] + push @configure_deps, '$(top_srcdir)/' . $args[1] unless $here =~ m,^(?:\w:)?[\\/],; } } diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 0a3700bf2..226870c6a 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -134,11 +134,27 @@ dist_perllib_DATA = \ all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; uninstall-info-am: dist_perllibDATA_INSTALL = $(INSTALL_DATA) install-dist_perllibDATA: $(dist_perllib_DATA) diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 9aa67222e..52ab779d1 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -114,11 +114,27 @@ EXTRA_DIST = $(TESTS) all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; uninstall-info-am: tags: TAGS TAGS: diff --git a/lib/Makefile.in b/lib/Makefile.in index 784a337a0..e376b5ce0 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -132,11 +132,27 @@ mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; uninstall-info-am: dist_pkgvdataDATA_INSTALL = $(INSTALL_DATA) install-dist_pkgvdataDATA: $(dist_pkgvdata_DATA) diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index e1c26674e..b76ad01c8 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -120,11 +120,27 @@ texinfos.am yacc.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/am/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/am/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; uninstall-info-am: dist_amDATA_INSTALL = $(INSTALL_DATA) install-dist_amDATA: $(dist_am_DATA) diff --git a/lib/am/configure.am b/lib/am/configure.am index fe53b48fb..cb265f3f1 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright 2001 +## Copyright (C) 2001, 2002, 2003 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -22,17 +22,44 @@ ## --------------------- ## ## This rule remakes the Makefile.in. -%MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) +%MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) %CONFIGURE_DEPS% +## If configure.ac or one of configure's dependencies has changed, all +## Makefile.in are to be updated; it is then more efficient to run +## automake on all the Makefiles at once. It also allow Automake to be +## run for newly added directories. + @for dep in $?; do \ + case '$(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) %CONFIGURE_DEPS%' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%'; \ + cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%; \ + exit 0;; \ + esac; \ + done; \ +## Otherwise, rebuild only this file. + echo ' cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES% ## This rule remakes the Makefile. %MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-IN% %MAKEFILE-DEPS% $(top_builddir)/config.status +## If Makefile is to be updated because of config.status, then run +## config.status without argument in order to (i) rerun all the +## AC_CONFIG_COMMANDS including those that are not visible to +## Automake, and (ii) to save time by running config.status all with +## all the files, instead of once per file (iii) generate Makefiles +## in newly added directories. + @case '$?' in \ +## Don't prefix $(top_builddir), because GNU make will strip it out +## when it's `.'. + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ ## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the ## .P files. Ideally we wouldn't have to do this by hand. - cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe) - - + echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \ + esac; ## --------------------------- ## ## config.status & configure. ## diff --git a/m4/Makefile.in b/m4/Makefile.in index 360f8a038..64a198123 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -147,11 +147,27 @@ EXTRA_DIST = dirlist all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; amversion.m4: $(top_builddir)/config.status amversion.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall-info-am: diff --git a/tests/Makefile.am b/tests/Makefile.am index cd0426f1c..14783df5f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in -XFAIL_TESTS = subdir5.test auxdir2.test cond17.test txinfo5.test +XFAIL_TESTS = subdir8.test auxdir2.test cond17.test txinfo5.test TESTS = \ acinclude.test \ @@ -383,6 +383,7 @@ subdir4.test \ subdir5.test \ subdir6.test \ subdir7.test \ +subdir8.test \ subdirbuiltsources.test \ subcond.test \ subcond2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index c2a218cee..12472b215 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -104,7 +104,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -XFAIL_TESTS = subdir5.test auxdir2.test cond17.test txinfo5.test +XFAIL_TESTS = subdir8.test auxdir2.test cond17.test txinfo5.test TESTS = \ acinclude.test \ aclibobj.test \ @@ -486,6 +486,7 @@ subdir4.test \ subdir5.test \ subdir6.test \ subdir7.test \ +subdir8.test \ subdirbuiltsources.test \ subcond.test \ subcond2.test \ @@ -578,11 +579,27 @@ check_SCRIPTS = defs all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + @for dep in $?; do \ + case '$(top_srcdir)/configure.in $(ACLOCAL_M4) ' in \ + *$$dep*) \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(top_srcdir) && $(AUTOMAKE) --gnu ; \ + exit 0;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + @case '$?' in \ + *config.status*) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status'; \ + cd $(top_builddir) && $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; defs: $(top_builddir)/config.status defs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall-info-am: diff --git a/tests/subdir5.test b/tests/subdir5.test index 038b111fb..ddcc1d548 100755 --- a/tests/subdir5.test +++ b/tests/subdir5.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -19,6 +19,8 @@ # Boston, MA 02111-1307, USA. # Test to make sure that adding a new directory works. +# This test runs `make' from the top-level directory, subdir8.test +# do it from a subdirectory. # PR automake/46 # This test assumes that the `make' utility is able to start @@ -26,12 +28,15 @@ required='GNUmake gcc' . ./defs || exit 1 +set -e + cat > configure.in << 'END' -AC_INIT(a.c) -AM_INIT_AUTOMAKE(maude, 1.0) +AC_INIT(maude, 1.0) +AM_INIT_AUTOMAKE AM_PROG_CC_C_O AC_PROG_CC -AC_OUTPUT(Makefile) +AC_CONFIG_FILES(Makefile) +AC_OUTPUT END cat > Makefile.am << 'END' @@ -48,8 +53,6 @@ int main () } END -set -e - $ACLOCAL $AUTOCONF $AUTOMAKE --include-deps --copy --add-missing @@ -58,13 +61,17 @@ $MAKE # Now add a new directory. cat > configure.in << 'END' -AC_INIT(a.c) -AM_INIT_AUTOMAKE(maude, 1.0) +AC_INIT(maude, 1.0) +AM_INIT_AUTOMAKE AM_PROG_CC_C_O AC_PROG_CC -AC_OUTPUT(Makefile maude/Makefile) +AC_CONFIG_FILES(Makefile maude/Makefile) +m4_include([confile.m4]) +AC_OUTPUT END +: > confile.m4 + mkdir maude cat > maude/Makefile.am << 'END' include_HEADERS = foo.h @@ -76,3 +83,17 @@ echo 'SUBDIRS = maude' >> Makefile.am # We want a simple rebuild to create maude/Makefile automatically. $MAKE +test -f maude/Makefile + +# Add yet another directory +mkdir maude2 +echo 'AC_CONFIG_FILES([maude2/Makefile])AC_SUBST([GREPME])' > confile.m4 +: > maude2/Makefile.am +echo 'SUBDIRS += maude2' >> Makefile.am + +# We want a simple rebuild to create maude2/Makefile and update +# all other Makefiles automatically. +$MAKE +grep GREPME Makefile +grep GREPME maude/Makefile +grep GREPME maude2/Makefile diff --git a/tests/subdir8.test b/tests/subdir8.test new file mode 100755 index 000000000..9ef721994 --- /dev/null +++ b/tests/subdir8.test @@ -0,0 +1,91 @@ +#! /bin/sh +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Test to make sure that adding a new directory works, even from +# subdirectories. (subdir5.test makes sure it works when make +# is run from the top-level directory.) +# PR automake/46 + +# This test assumes that the `make' utility is able to start +# over and reload Makefiles which have been remade (a non-POSIX feature). +required='GNUmake gcc' +. ./defs || exit 1 + +set -e + +echo 'AC_CONFIG_FILES([sub/Makefile])' >confiles.m4 + +cat >> configure.in << 'END' +AM_PROG_CC_C_O +AC_PROG_CC +m4_include([confiles.m4]) +AC_OUTPUT +END + +echo 'SUBDIRS = sub' > Makefile.am + +mkdir sub + +cat > sub/Makefile.am << 'END' +bin_PROGRAMS = wish +wish_SOURCES = a.c +END + +cat > sub/a.c << 'END' +#include +int main () +{ + printf ("hi liver!\n"); + return 0; +} +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --copy --add-missing +./configure +$MAKE + +# Now add a new directory. + +mkdir sub/maude +cat > sub/maude/Makefile.am << 'END' +include_HEADERS = foo.h +END + +: > sub/maude/foo.h + +echo 'SUBDIRS = maude' >> sub/Makefile.am + +mkdir maude +: > maude/Makefile.am + +# Update confile.m4 *after* updating sub/Makefile.am. +# (subdir5.test do it in the other way: it updates configure.in +# before Makefile.am) +echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.m4 + +# We want a simple rebuild from sub/ to create sub/maude/Makefile +# and maude/Makefile automatically. +cd sub +$MAKE +cd .. +test -f maude/Makefile +test -f sub/maude/Makefile