]> sourceware.org Git - automake.git/commitdiff
2001-02-12 Tom Tromey <tromey@redhat.com>
authorTom Tromey <tromey@redhat.com>
Mon, 12 Feb 2001 16:49:52 +0000 (16:49 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 12 Feb 2001 16:49:52 +0000 (16:49 +0000)
Fix for subdirbuiltsources.test:
* automake.in (initialize_per_input): [all_target] Initialize to
empty string.
(handle_merge_targets): Use all-redirect target to handle built
sources.
(do_one_merge_target): Don't generate all-redirect rule.

2001-02-11  Peter Muir  <iyhi@yahoo.com>

* tests/subdirbuiltsources.test: New file.
* tests/Makefile.am (TESTS): Added new file.

ChangeLog
THANKS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/subdirbuiltsources.test [new file with mode: 0755]

index d70474256a626de5f774efd5cb5de8ea1ca02c80..26dadd184d383e341044f63f0c6512e268b97635 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-02-12  Tom Tromey  <tromey@redhat.com>
+
+       Fix for subdirbuiltsources.test:
+       * automake.in (initialize_per_input): [all_target] Initialize to
+       empty string.
+       (handle_merge_targets): Use all-redirect target to handle built
+       sources.
+       (do_one_merge_target): Don't generate all-redirect rule.
+
+2001-02-11  Peter Muir  <iyhi@yahoo.com>
+
+       * tests/subdirbuiltsources.test: New file.
+       * tests/Makefile.am (TESTS): Added new file.
+
 2001-02-10  Tom Tromey  <tromey@redhat.com>
 
        * tests/condlib.test: New file.
diff --git a/THANKS b/THANKS
index 463a8aaebc87c72628f164735de7707d6349706a..0c06acf81b46b7f9a701a5e178f8b4cc3b53dfd2 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -109,6 +109,7 @@ Pavel Roskin                pavel_roskin@geocities.com
 Per Bothner            bothner@cygnus.com
 Per Cederqvist         ceder@lysator.liu.se
 Peter Mattis           petm@scam.XCF.Berkeley.EDU
+Peter Muir             iyhi@yahoo.com
 Petter Reinholdtsen    pere@hungry.com
 Phil Nelson            phil@cs.wwu.edu
 Raja R Harinath                harinath@cs.umn.edu
index 94bca1b3069b61fc82504b80cbaaf1c2d772efcb..8c13a5d0e7627cc0f731c22de9272ce06552b20c 100755 (executable)
@@ -3679,19 +3679,20 @@ sub handle_merge_targets
        }
        if ($local_headers)
        {
-           # This is kind of a hack, but I couldn't see a better way
-           # to handle it.  In this particular case, we need to make
-           # sure config.h is built before we recurse.  We can't do
-           # this by changing the order of dependencies to the "all"
-           # because that breaks when using parallel makes.  Instead
-           # we handle things explicitly.
-           $output_rules .= ("all-recursive-am: ${local_headers}"
-                                 . "\n\t"
-                                 . '$(MAKE) $(AM_MAKEFLAGS)'
-                                 . " all-recursive"
-                                 . "\n\n");
-           $all_target = 'all-recursive-am';
-           &depend ('.PHONY', 'all-recursive-am');
+           # We need to make sure config.h is built before we
+           # recurse.  We also want to make sure that built sources
+           # are built before any ordinary `all' targets are run.  We
+           # can't do this by changing the order of dependencies to
+           # the "all" because that breaks when using parallel makes.
+           # Instead we handle things explicitly.
+           $output_rules .= ("all-redirect: ${local_headers}"
+                             . "\n\t"
+                             . '$(MAKE) $(AM_MAKEFLAGS) '
+                             . ($recursive_install
+                                ? 'all-recursive' : 'all-am')
+                             . "\n\n");
+           $all_target = 'all-redirect';
+           &depend ('.PHONY', 'all-redirect');
        }
     }
 
@@ -3755,18 +3756,24 @@ sub do_one_merge_target
                          . "\n");
     }
 
-    local ($lname) = $name . ($recursive_install ? '-recursive' : '-am');
-    local ($tname) = $name;
     # To understand this special case, see handle_merge_targets.
     if ($name eq 'all')
     {
-       $tname = 'all-redirect';
-       $lname = $all_target if $recursive_install;
-       &depend ('.PHONY', 'all-redirect');
-       $output_all = "all: all-redirect\n";
+       # If we aren't using a redirect target then find the
+       # appropriate actual redirect.
+       if ($all_target eq '')
+       {
+           $all_target = $recursive_install ? 'all-recursive' : 'all-am';
+       }
+
+       $output_all = "all: $all_target\n";
+    }
+    else
+    {
+       local ($lname) = $name . ($recursive_install ? '-recursive' : '-am');
+       &pretty_print_rule ($name . ":", "\t\t", $lname);
+       &depend ('.PHONY', $name . '-am', $name);
     }
-    &pretty_print_rule ($tname . ":", "\t\t", $lname);
-    &depend ('.PHONY', $name . '-am', $name);
 }
 
 # Handle check merge target specially.
@@ -6815,8 +6822,8 @@ sub initialize_per_input
     # position of a suffix rule.
     $source_suffix_pattern = '';
 
-    # This is the name of the recursive `all' target to use.
-    $all_target = 'all-recursive';
+    # This is the name of the redirect `all' target to use.
+    $all_target = '';
 
     # This keeps track of which extensions we've seen (that we care
     # about).
index 370271658d4973bd8c93bde1aab8328d8d8efab3..1c46b23de4392acd7b2f01f920b589ba4c575275 100644 (file)
@@ -234,6 +234,7 @@ subdir.test \
 subdir2.test \
 subdir3.test \
 subdir4.test \
+subdirbuiltsources.test \
 subobj.test \
 subobj2.test \
 subobj3.test \
index b8783a5ecdd3f89aed54b20fda1943bc018c57a4..7bb2cb49361a42ec790de21739edf3fbae1131a6 100644 (file)
@@ -304,6 +304,7 @@ subdir.test \
 subdir2.test \
 subdir3.test \
 subdir4.test \
+subdirbuiltsources.test \
 subobj.test \
 subobj2.test \
 subobj3.test \
diff --git a/tests/subdirbuiltsources.test b/tests/subdirbuiltsources.test
new file mode 100755 (executable)
index 0000000..264d5b2
--- /dev/null
@@ -0,0 +1,62 @@
+#! /bin/sh
+
+set -e
+# Make sure when using SUBDIR that all BUILT_SOURCES are built.
+# A bug occurred where subdirs do not have all-recursive or
+# all-recursive-am which depended on BUILT_SOURCES.
+
+. $srcdir/defs || exit 1
+
+mkdir lib
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_ARG_PROGRAM
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_PROG_CC
+AC_OUTPUT(Makefile lib/Makefile)
+END
+
+# Files required because we are using `--gnu'.
+: > INSTALL
+: > NEWS
+: > README
+: > COPYING
+: > AUTHORS
+: > ChangeLog
+
+cat > Makefile.am << 'END'
+SUBDIRS = lib
+END
+
+cat > lib/Makefile.am << 'END'
+pkgdata_DATA =
+noinst_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = foo.c
+BUILT_SOURCES=foo.h
+foo.h: 
+       echo \#define FOO_DEFINE 1 >$@
+END
+
+cat > lib/foo.c << 'END'
+#include <foo.h>
+int foo () { return !FOO_DEFINE;}
+END
+
+
+$ACLOCAL
+
+$AUTOCONF
+
+$AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu
+
+./configure
+
+# Remove the comment to get a successful test.
+# $MAKE -C lib foo.h
+$MAKE
+
+exit 0
This page took 0.098969 seconds and 5 git commands to generate.