An explicitly mentioned double-colon target cannot be intermediate.
* src/read.c (record_files): Set file->is_explicit in the case of an
explicitly mentioned file built by a double colon rule.
* src/file.c (print_file): Have print_file print whether a file is
explicitly mentioned.
* tests/scripts/features/patternrules: Add tests.
puts (_("# File is a prerequisite of .NOTINTERMEDIATE."));
if (f->secondary)
puts (_("# File is secondary (prerequisite of .SECONDARY)."));
+ if (f->is_explicit)
+ puts (_("# File is explicitly mentioned."));
+
if (f->also_make != 0)
{
const struct dep *d;
free_dep_chain (f->deps);
f->deps = 0;
}
- /* This file is explicitly mentioned as a target. There is no need
- to set is_explicit in the case of double colon below, because an
- implicit double colon rule only applies when the prerequisite
- exists. A prerequisite which exists is not intermediate anyway. */
- f->is_explicit = 1;
}
else
{
f->cmds = cmds;
}
+ /* This file is explicitly mentioned as a target. */
+ f->is_explicit = 1;
if (are_also_makes)
{
unlink('b/hello.q');
rmdir('b');
+# SV 66273. An explicitly mentioned prerequisite is not intermediate, even in
+# the case of double colon.
+unlink('hello.q', 'hello.x');
+run_make_test(q!
+all: hello.x
+%.x: %.q; $(info $@ from $<)
+hello.q::; touch $@
+!,
+ '', "touch hello.q\nhello.x from hello.q\n");
+unlink('hello.q');
+
# This tells the test driver that the perl test script executed properly.
1;