mirror of
https://github.com/mirror/make.git
synced 2026-09-04 21:52:55 +08:00
[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().
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user