From: Dmitry Goncharov Date: Sat, 17 Dec 2022 19:12:41 +0000 (-0500) Subject: [SV 63484] Force included makefiles to be explicit X-Git-Tag: 4.4.0.90~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95c2db7b8d95529e00dd2988c0b3901a0cb9aa17;p=thirdparty%2Fmake.git [SV 63484] Force included makefiles to be explicit Ensure included makefiles are not treated as intermediate, even if they are created by an implicit rule. Reported by Patrick Oppenlander . * src/read.c (eval_makefile): Mark makefiles as explicit. * tests/scripts/features/include: Add a test. --- diff --git a/src/read.c b/src/read.c index b46b48fc..9f2ed5cf 100644 --- a/src/read.c +++ b/src/read.c @@ -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); diff --git a/tests/scripts/features/include b/tests/scripts/features/include index 7f216434..76e365b9 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -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;