From: Alexandre Duret-Lutz Date: Thu, 24 Jul 2003 21:26:56 +0000 (+0000) Subject: Fix missing rebuilds during `make dist' with BSD make. X-Git-Tag: v1.10.2~829 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfea6a81f5500a39b4a1efff818fe586331d5742;p=platform%2Fupstream%2Fautomake.git Fix missing rebuilds during `make dist' with BSD make. * automake.in (generate_makefile): Do not push Makefile.in, and Makefile.am into DIST_COMMON here. * lib/am/configure.am (DIST_COMMON): Do it here, and use %MAKEFILE-AM% and %MAKEFILE-IN% so that items in DIST_COMMON actually match the targets. Prefix `configure' with `$(srcdir)/' to match the target. * tests/remake4.test: New file. * tests/Makefile.am (TESTS): Add remake4.test. Report from Akim Demaille. --- diff --git a/ChangeLog b/ChangeLog index e766477..a33b0ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-07-24 Alexandre Duret-Lutz + + Fix missing rebuilds during `make dist' with BSD make. + * automake.in (generate_makefile): Do not push Makefile.in, and + Makefile.am into DIST_COMMON here. + * lib/am/configure.am (DIST_COMMON): Do it here, and use + %MAKEFILE-AM% and %MAKEFILE-IN% so that items in DIST_COMMON + actually match the targets. Prefix `configure' with `$(srcdir)/' + to match the target. + * tests/remake4.test: New file. + * tests/Makefile.am (TESTS): Add remake4.test. + Report from Akim Demaille. + 2003-07-23 Alexandre Duret-Lutz * automake.in (handle_multilib): Register all-multi. diff --git a/Makefile.in b/Makefile.in index 9bd3008..136f5b5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,10 +34,11 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = README $(am__configure_deps) AUTHORS COPYING ChangeLog \ - INSTALL Makefile.am Makefile.in NEWS THANKS TODO aclocal.m4 \ - configure configure.in stamp-vti version.texi subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \ + Makefile.am NEWS THANKS TODO aclocal.m4 configure configure.in \ + stamp-vti version.texi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/amversion.m4 $(top_srcdir)/m4/options.m4 \ diff --git a/automake.in b/automake.in index 4fb66e8..c4084c1 100755 --- a/automake.in +++ b/automake.in @@ -7170,7 +7170,7 @@ sub generate_makefile # $OUTPUT is encoded. If it contains a ":" then the first element # is the real output file, and all remaining elements are input - # files. We don't scan or otherwise deal with these input file, + # files. We don't scan or otherwise deal with these input files, # other than to mark them as dependencies. See # &scan_autoconf_files for details. my (@secondary_inputs); @@ -7220,15 +7220,6 @@ sub generate_makefile if $seen_canonical; } - # We still need Makefile.in here, because sometimes the `dist' - # target doesn't re-run automake. - if ($am_relative_dir eq $relative_dir) - { - # Only distribute the files if they are in the same subdir as - # the generated makefile. - push_dist_common ($in_file_name, $am_file_name); - } - # Must do this after reading .am file. define_variable ('subdir', $relative_dir, INTERNAL); diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index c5da1bc..21e7aef 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -34,7 +34,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = $(dist_perllib_DATA) Makefile.am Makefile.in subdir = lib/Automake ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -45,6 +44,7 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = $(dist_perllib_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 7682063..5adfdde 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -33,7 +33,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.am Makefile.in subdir = lib/Automake/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -44,6 +43,7 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = diff --git a/lib/Makefile.in b/lib/Makefile.in index 1b30a74..b64f556 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -34,10 +34,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) COPYING \ - INSTALL Makefile.am Makefile.in ansi2knr.1 ansi2knr.c compile \ - config.guess config.sub depcomp elisp-comp install-sh mdate-sh \ - missing mkinstalldirs py-compile texinfo.tex ylwrap subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -48,6 +44,11 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \ + $(srcdir)/Makefile.in COPYING INSTALL Makefile.am ansi2knr.1 \ + ansi2knr.c compile config.guess config.sub depcomp elisp-comp \ + install-sh mdate-sh missing mkinstalldirs py-compile \ + texinfo.tex ylwrap mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 27a3e84..196596b 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -34,7 +34,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = $(dist_am_DATA) Makefile.am Makefile.in subdir = lib/am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -45,6 +44,7 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = $(dist_am_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = diff --git a/lib/am/configure.am b/lib/am/configure.am index 7a51904..2f399ae 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -28,7 +28,6 @@ am--refresh: @: endif %?TOPDIR_P% - ## --------------------- ## ## Building Makefile.*. ## ## --------------------- ## @@ -76,6 +75,8 @@ endif %?TOPDIR_P% cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \ esac; +DIST_COMMON += %MAKEFILE-AM% %MAKEFILE-IN% + ## --------------------------- ## ## config.status & configure. ## @@ -86,7 +87,7 @@ if %?TOPDIR_P% ## don't exist. This is especially important for configure, since it ## won't be created until autoconf is run -- which might be after ## automake is run. -DIST_COMMON += configure %CONFIGURE-AC% $(am__configure_deps) +DIST_COMMON += $(top_srcdir)/configure %CONFIGURE-AC% $(am__configure_deps) endif %?TOPDIR_P% $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) diff --git a/m4/Makefile.in b/m4/Makefile.in index f0ccdde..7060453 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -34,7 +34,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = $(dist_m4data_DATA) Makefile.am Makefile.in subdir = m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -45,6 +44,7 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = diff --git a/tests/Makefile.am b/tests/Makefile.am index d36edcc..a7b1490 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -363,6 +363,7 @@ recurs2.test \ remake.test \ remake2.test \ remake3.test \ +remake4.test \ req.test \ reqd.test \ reqd2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 6720914..b879bb5 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -33,7 +33,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = README Makefile.am Makefile.in defs.in subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -44,6 +43,7 @@ am__configure_deps = $(top_srcdir)/m4/init.m4 \ $(top_srcdir)/m4/depend.m4 $(top_srcdir)/m4/depout.m4 \ $(top_srcdir)/m4/make.m4 $(top_srcdir)/m4/cond.m4 \ $(top_srcdir)/m4/runlog.m4 +DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am defs.in mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = defs SOURCES = @@ -474,6 +474,7 @@ recurs2.test \ remake.test \ remake2.test \ remake3.test \ +remake4.test \ req.test \ reqd.test \ reqd2.test \ diff --git a/tests/remake4.test b/tests/remake4.test new file mode 100755 index 0000000..8a713e0 --- /dev/null +++ b/tests/remake4.test @@ -0,0 +1,61 @@ +#! /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. + +# Make sure Makefile.in are up to date after make dist. +# This is expected to work even without GNU Make (the GNU Make +# feature that isn't supported elsewhere is the rebuild of +# Makefile dependencies during ordinary builds). +# +# If this fails, this is likely to be due to a dependency being +# given two different name. For instance BSD Make does not know +# that `Makefile' is the same as `./Makefile' +# +# Report from Akim Demaille. + +. ./defs || exit 1 + +set -e + +cat >>configure.in <<'EOF' +# Rebuild rule are ok until make dist, but not afterwards. +if test ! -f rebuild_ok; then + ACLOCAL=false + AUTOMAKE=false + AUTOCONF=false +fi +AC_OUTPUT +EOF + +: > rebuild_ok +: > Makefile.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing +./configure +$MAKE +$sleep +touch aclocal.m4 +$MAKE dist +tar zxvf remake4-1.0.tar.gz +cd remake4-1.0 +test ! -f rebuild_ok +./configure +$MAKE