From 01833933f05adafa699fe471660330805bd62388 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 5 Dec 2001 17:13:39 +0000 Subject: [PATCH] * automake.in (handle_dist): Distribute common files which do not exist but are target of a Makefile rule. * automake.texi (Dist): Update. * test/builtcommon3.test: New file. * test/Makefile.am (TESTS): Add distcommon3.test. --- ChangeLog | 8 ++++++++ automake.in | 4 +++- automake.texi | 5 +++-- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/distcommon3.test | 23 +++++++++++++++++++++++ 6 files changed, 39 insertions(+), 3 deletions(-) create mode 100755 tests/distcommon3.test diff --git a/ChangeLog b/ChangeLog index 4d85c720..163e0cc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-12-05 Alexandre Duret-Lutz + + * automake.in (handle_dist): Distribute common files which + do not exist but are target of a Makefile rule. + * automake.texi (Dist): Update. + * test/builtcommon3.test: New file. + * test/Makefile.am (TESTS): Add distcommon3.test. + 2001-12-04 Alexandre Duret-Lutz * automake.in (macro_define): Fix misuse of chomp introduced on diff --git a/automake.in b/automake.in index 2f6092ed..7f075c85 100755 --- a/automake.in +++ b/automake.in @@ -3375,7 +3375,9 @@ sub handle_dist } foreach my $cfile (@common_files) { - if (-f ($relative_dir . "/" . $cfile)) + if (-f ($relative_dir . "/" . $cfile) + # The file might be absent, but if it can be built it's ok. + || exists $targets{$cfile}) { &push_dist_common ($cfile); } diff --git a/automake.texi b/automake.texi index 7f1d8f51..1682e9e8 100644 --- a/automake.texi +++ b/automake.texi @@ -3600,8 +3600,9 @@ is run. The default setting is @samp{--best}. For the most part, the files to distribute are automatically found by Automake: all source files are automatically included in a distribution, as are all @file{Makefile.am}s and @file{Makefile.in}s. Automake also -has a built-in list of commonly used files which, if present in the -current directory, are automatically included. This list is printed by +has a built-in list of commonly used files which are automatically +included if they are found in the current directory (either physically, +or as the target of a @file{Makefile.am} rule). This list is printed by @samp{automake --help}. Also, files which are read by @code{configure} (i.e. the source files corresponding to the files specified in the @code{AC_OUTPUT} invocation) are automatically distributed. diff --git a/tests/Makefile.am b/tests/Makefile.am index a03a8668..22b21dd8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -118,6 +118,7 @@ dirname.test \ discover.test \ distcommon.test \ distcommon2.test \ +distcommon3.test \ distdir.test \ distname.test \ double.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 4f97e86a..b453462b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -191,6 +191,7 @@ dirname.test \ discover.test \ distcommon.test \ distcommon2.test \ +distcommon3.test \ distdir.test \ distname.test \ double.test \ diff --git a/tests/distcommon3.test b/tests/distcommon3.test new file mode 100755 index 00000000..f093b107 --- /dev/null +++ b/tests/distcommon3.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Test to make sure that non-existing common files are distributed +# if they are buildable. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +README: + echo 'I bet you are reading me.' > README +END + +$ACLOCAL || exit 1 +$AUTOMAKE || exit 1 + +sed -n -e '/^DIST_COMMON =.*\\$/ { + :loop + p + n + /\\$/ b loop + p + n + }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README || exit 1 -- 2.43.5