[SV 63417] Ensure global .NOTINTERMEDIATE disables all intermediates

Fix .NOTINTERMEDIATE without prerequisites to disable intermediate
status for all targets.

* src/makeint.h: Declare extern no_intermediates.
* src/main.c: Add global definition of no_intermediates.
* src/file.c: Remove static no_intermediates to use global variable.
(remove_intermediates): Check no_intermediates.
* src/implicit.c (pattern_search): For a file found by implicit search
set file->notintermediate if no_intermediates is set.
* src/remake.c (update_file_1): Don't set file->secondary for a
pre-existing file if no_intermediates is set.  The check for
no_intermediates here is redundant, but won't hurt: keep it in case
things change so that it matters.
* tests/scripts/targets/NOTINTERMEDIATE: Fix a test.
This commit is contained in:
Dmitry Goncharov
2022-11-27 15:40:28 -05:00
committed by Paul Smith
parent a99183ed2b
commit 6164608900
6 changed files with 12 additions and 12 deletions

View File

@@ -36,7 +36,6 @@ hello.z:
# Test 4. .NOTINTERMEDIATE without prerequisites makes everything
# notintermediate.
unlink('hello.z');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
@@ -112,8 +111,6 @@ hello.z:
.SECONDARY:
!, '', "touch hello.z\n");
unlink('hello.z');
# This tells the test driver that the perl test script executed properly.
1;