]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Implemented dontcare flag inheritance when rebuilding makefiles.
authorBoris Kolpackov <boris@kolpackov.net>
Tue, 28 Sep 2004 18:13:55 +0000 (18:13 +0000)
committerBoris Kolpackov <boris@kolpackov.net>
Tue, 28 Sep 2004 18:13:55 +0000 (18:13 +0000)
ChangeLog
remake.c
tests/ChangeLog
tests/scripts/features/include

index 7ad0ab8e60df29abc4f71085216393648f0e785d..53fa8df0fe46c928b526c00a33d7f3aea7db754d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-28  Boris Kolpackov  <boris@kolpackov.net>
+
+       * remake.c (update_file_1): When rebuilding makefiles inherit
+       dontcare flag from a target that triggered update.
+
 2004-09-27  Boris Kolpackov  <boris@kolpackov.net>
 
        * variable.c (initialize_file_variables): Mark pattern-specific
index b0c76dc0fdd06a29c86049a65701c1c6c72a7de1..70acad3361d5d0ede502b91b3f570194b3e491cc 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -468,6 +468,7 @@ update_file_1 (struct file *file, unsigned int depth)
     {
       FILE_TIMESTAMP mtime;
       int maybe_make;
+      int dontcare = 0;
 
       check_renamed (d->file);
 
@@ -491,7 +492,21 @@ update_file_1 (struct file *file, unsigned int depth)
 
       d->file->parent = file;
       maybe_make = must_make;
+
+      /* Inherit dontcare flag from our parent. */
+      if (rebuilding_makefiles)
+        {
+          dontcare = d->file->dontcare;
+          d->file->dontcare = file->dontcare;
+        }
+
+
       dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
+
+      /* Restore original dontcare flag. */
+      if (rebuilding_makefiles)
+        d->file->dontcare = dontcare;
+
       if (! d->ignore_mtime)
         must_make = maybe_make;
 
@@ -528,10 +543,26 @@ update_file_1 (struct file *file, unsigned int depth)
       for (d = file->deps; d != 0; d = d->next)
        if (d->file->intermediate)
          {
+            int dontcare = 0;
+
            FILE_TIMESTAMP mtime = file_mtime (d->file);
            check_renamed (d->file);
            d->file->parent = file;
+
+            /* Inherit dontcare flag from our parent. */
+            if (rebuilding_makefiles)
+              {
+                dontcare = d->file->dontcare;
+                d->file->dontcare = file->dontcare;
+              }
+
+
            dep_status |= update_file (d->file, depth);
+
+            /* Restore original dontcare flag. */
+            if (rebuilding_makefiles)
+              d->file->dontcare = dontcare;
+
            check_renamed (d->file);
 
            {
index 8420705b92a54377cab7219d56b389da0eab0e53..87c64d5c6faf4a43213d4dfac81ee6091a461fc3 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-28  Boris Kolpackov  <boris@kolpackov.net>
+
+       * scripts/features/include: Test dontcare flag inheritance
+       when rebuilding makefiles.
+
 2004-09-27  Boris Kolpackov  <boris@kolpackov.net>
 
        * scripts/features/patspecific_vars: Test exported variables.
index 5f20ad87a738d25d4a6a80b6d4d0ea5def9f9fef..f48cbd3f421ce8f18ad1bf820934226261ae96d4 100644 (file)
@@ -16,7 +16,7 @@ open(MAKEFILE,"> $makefile");
 
 print MAKEFILE <<EOF;
 \#Extra space at the end of the following file name
-include $makefile2                  
+include $makefile2
 all: ; \@echo There should be no errors for this makefile.
 
 -include nonexistent.mk
@@ -78,5 +78,15 @@ hello: ; @echo hello
    "hello\n"
   );
 
+# Test inheritance of dontcare flag when rebuilding makefiles.
+#
+run_make_test('
+.PHONY: all
+all: ; @:
+
+-include foo
+
+foo: bar; @:
+', '', '');
 
 1;