diff options
author | Paul Smith <psmith@gnu.org> | 2022-10-22 19:09:44 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-10-22 22:40:26 -0400 |
commit | bb0c05a7f0329dd2ea38021e9c0b9e74e0cdb7de (patch) | |
tree | 1e4748af4391c77526650e2a4dee0d38f4359dd1 /tests | |
parent | f987d181c40270359f4d89fbe3daa1966634bac2 (diff) | |
download | make-git-bb0c05a7f0329dd2ea38021e9c0b9e74e0cdb7de.tar.gz |
[SV 63098] Enhance detection of missing peer also-make targets
The previous attempt to detect missing peer targets for implicit
rules had some holes. Move the detection to notice_finished_file().
* src/remake.c (check_also_make): If we don't have the current mtime
for the file, obtain it.
(update_goal_chain): Don't call check_also_make() here.
(check_dep): Ditto.
(notice_finished_file): If we finished running an implicit rule that
has also_make targets, invoke check_also_make().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/features/patternrules | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules index a4107432..b5b70347 100644 --- a/tests/scripts/features/patternrules +++ b/tests/scripts/features/patternrules @@ -478,6 +478,20 @@ run_make_test(q! 'gta', "touch gta\n#MAKEFILE#:2: warning: pattern recipe did not update peer target 'gtb'.\n"); unlink(qw(gta)); +# We don't warn if we didn't update the file +utouch(-10, qw(gta)); +run_make_test(q! +%a %b : xyzzy ; $(OP) +xyzzy: ; +ifdef RUN +OP = @echo no +endif +!, + '-rR gta', "#MAKE#: 'gta' is up to date.\n"); + +run_make_test(undef, '-rR gta RUN=1', "no\n"); +unlink(qw(gta)); + run_make_test(q! all:; include gta @@ -486,6 +500,14 @@ include gta '', "touch gta\n#MAKEFILE#:4: warning: pattern recipe did not update peer target 'gtb'.\n#MAKE#: 'all' is up to date."); unlink(qw(gta)); +run_make_test(q! +%.c %.h : %.y; touch $*.c +%.o: %.c; touch $@ +foo.y: ; touch $@ +!, + 'foo.o', "touch foo.y\ntouch foo.c\n#MAKEFILE#:2: warning: pattern recipe did not update peer target 'foo.h'.\ntouch foo.o\nrm foo.c"); +unlink(qw(foo.y foo.c foo.o)); + if (0) { # SV 12078: Missing grouped pattern peer causes remake regardless of which # target caused the rule to run. |