Fixed bug #13022 by setting is_target flag on files that this implicit
authorBoris Kolpackov <boris@kolpackov.net>
Fri, 9 Dec 2005 16:46:19 +0000 (16:46 +0000)
committerBoris Kolpackov <boris@kolpackov.net>
Fri, 9 Dec 2005 16:46:19 +0000 (16:46 +0000)
pattern rule also makes.

ChangeLog
implicit.c
tests/ChangeLog
tests/scripts/features/patternrules

index 5d30cff25e7796f8fbbb541d4cd173485ecb6f0b..917a304e2197a617f83daf24496b30b521088571 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-09  Boris Kolpackov  <boris@kolpackov.net>
+
+       * implicit.c (pattern_search): Mark other files that this rule
+       builds as targets so that they are not treated as intermediates
+       by the pattern rule search algorithm. Fixes bug #13022.
+
 2005-12-07  Boris Kolpackov  <boris@kolpackov.net>
 
        * remake.c (notice_finished_file): Propagate the change of
index ad873f1fabc164868f203653da37c91855036698..cfd6629044681d5f09ee0579c2b2e187e98520e9 100644 (file)
@@ -928,6 +928,11 @@ pattern_search (struct file *file, int archive,
          if (f && f->precious)
             new->file->precious = 1;
 
+          /* Set the is_target flag so that this file is not treated
+             as intermediate by the pattern rule search algorithm and
+             file_exists_p cannot pick it up yet.  */
+          new->file->is_target = 1;
+
          file->also_make = new;
        }
 
index 93cac8740de886a24b07cc43981368149287bd08..e222ef1e5fd862d8a826f0248142948ce49f7713 100644 (file)
@@ -1,3 +1,7 @@
+2005-12-09  Boris Kolpackov  <boris@kolpackov.net>
+
+       * scripts/features/patternrules: Add a test for bug #13022.
+
 2005-12-07  Boris Kolpackov  <boris@kolpackov.net>
 
        * scripts/features/double_colon: Add a test for bug #14334.
index 1753d4d8e5d151f3d1676f66bd8bf63c3edd4790..90525aede49c4016f19eb66247e892539af8b840 100644 (file)
@@ -115,5 +115,35 @@ $(dir)/foo.bar:
 
 unlink("$dir/foo.bar");
 
+
+# TEST #5: make sure targets of a macthed implicit pattern rule never
+#          never considered intermediate (Savannah bug #13022).
+#
+run_make_test('
+.PHONY: all
+all: foo.c foo.o
+
+%.h %.c: %.in
+       touch $*.h
+       touch $*.c
+
+%.o: %.c %.h
+       echo $+ >$@
+
+%.o: %.c
+       @echo wrong rule
+
+foo.in:
+       touch $@
+
+',
+'',
+'touch foo.in
+touch foo.h
+touch foo.c
+echo foo.c foo.h >foo.o');
+
+unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
+
 # This tells the test driver that the perl test script executed properly.
 1;