]> git.ipfire.org Git - thirdparty/make.git/commitdiff
[SV 63484] Force included makefiles to be explicit
authorDmitry Goncharov <dgoncharov@users.sf.net>
Sat, 17 Dec 2022 19:12:41 +0000 (14:12 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 19 Dec 2022 01:06:38 +0000 (20:06 -0500)
Ensure included makefiles are not treated as intermediate, even if
they are created by an implicit rule.
Reported by Patrick Oppenlander <patrick.oppenlander@gmail.com>.

* src/read.c (eval_makefile): Mark makefiles as explicit.
* tests/scripts/features/include: Add a test.

src/read.c
tests/scripts/features/include

index b46b48fc04d5d2fbc6eb57891efa68d2ebe333ab..9f2ed5cfbe3675328501184a3fbf59baaeb1718d 100644 (file)
@@ -404,6 +404,7 @@ eval_makefile (const char *filename, unsigned short flags)
     deps->file = enter_file (filename);
   filename = deps->file->name;
   deps->flags = flags;
+  deps->file->is_explicit = 1;
 
   free (expanded);
 
index 7f216434f854bd6deea66dca4b4dc275d7b1bc4a..76e365b9a6cd702f795bc6e9b95f9538fee66483 100644 (file)
@@ -472,4 +472,19 @@ all: ;
                   '', "C:__foobar\n#MAKE#: 'all' is up to date.");
 }
 
+# sv 63484.
+# Test that included makefiles are not intermediate.
+# Here 'test.foo' is mentioned explicitly and cannot be considered
+# intermediate.
+&touch('test.foo', 'test.x', 'test');
+run_make_test(q!
+.PHONY: force
+include test.foo
+%.foo: force; touch -a $@
+%.x: %.foo; touch $@
+test: test.x; touch $@
+!, '', "touch -a test.foo\n#MAKE#: 'test' is up to date.\n");
+
+unlink('test.foo', 'test.x', 'test');
+
 1;