automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

built-common-file.patch


From: Alexandre Duret-Lutz
Subject: built-common-file.patch
Date: 01 Dec 2001 23:10:04 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

In a project, I have this in $(top_srcdir)/Makefile.am:

| # Some files, such as AUTHORS or THANKS, usually automatically added
| # by automake are listed here because they don't exist on the CVS
| # but are generated from a rule in this Makefile (and automake
| # is not smart enough to handle this :o)).
| EXTRA_DIST = ... AUTHORS ... THANKS ...
| AUTHORS: ...
|         ...
| THANKS: ...
|         ...

The following would make that comment obsolete.

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,9 @@
+2001-12-01  Alexandre Duret-Lutz  <address@hidden>
+
+       * 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.
+

Index: automake.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011201-2207/automake.in,v
retrieving revision 1.1
diff -u -r1.1 automake.in
--- automake.in 1 Dec 2001 21:07:42 -0000 1.1
+++ automake.in 1 Dec 2001 21:33:39 -0000
@@ -3375,7 +3375,9 @@
     }
     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);
        }
Index: automake.texi
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011201-2207/automake.texi,v
retrieving revision 1.1
diff -u -r1.1 automake.texi
--- automake.texi 1 Dec 2001 21:07:42 -0000 1.1
+++ automake.texi 1 Dec 2001 21:48:17 -0000
@@ -3600,8 +3600,9 @@
 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.
Index: tests/Makefile.am
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011201-2207/tests/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- tests/Makefile.am 1 Dec 2001 21:07:43 -0000 1.1
+++ tests/Makefile.am 1 Dec 2001 21:38:16 -0000
@@ -118,6 +118,7 @@
 discover.test \
 distcommon.test \
 distcommon2.test \
+distcommon3.test \
 distdir.test \
 distname.test \
 double.test \
Index: tests/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011201-2207/tests/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- tests/Makefile.in 1 Dec 2001 21:07:43 -0000 1.1
+++ tests/Makefile.in 1 Dec 2001 21:38:18 -0000
@@ -191,6 +191,7 @@
 discover.test \
 distcommon.test \
 distcommon2.test \
+distcommon3.test \
 distdir.test \
 distname.test \
 double.test \
Index: tests/distcommon3.test
===================================================================
RCS file: tests/distcommon3.test
diff -N tests/distcommon3.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/distcommon3.test 1 Dec 2001 21:30:25 -0000
@@ -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

-- 
Alexandre Duret-Lutz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]