summaryrefslogtreecommitdiff
path: root/src/implicit.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2021-12-29 14:44:46 -0500
committerPaul Smith <psmith@gnu.org>2021-12-29 15:26:56 -0500
commit6682fbc2cb72343fa89979ad2fed83b01e423004 (patch)
tree3cb2ea15f11c60e5d576044c3c1efb85bcf6d913 /src/implicit.c
parentf2b130bda889e04082187d4cf97adf6bab58ed7b (diff)
downloadmake-git-6682fbc2cb72343fa89979ad2fed83b01e423004.tar.gz
Do not force targets to be SECONDARY
In SV 43677 we forced targets to be secondary if we found an intermediate file that was listed as a prerequisite of another target. This overrides .INTERMEDIATE settings, so doesn't work. Now that we have an is_explicit flag in targets, use that instead. * src/implicit.c (pattern_search): Remove setting of secondary. Preserve the value of the is_explicit flag when creating a new file target, and consider it when setting the intermediate flag. * tests/scripts/features/patternrules: Add a test w/out INTERMEDIATE * tests/scripts/targets/INTERMEDIATE: Add a test with INTERMEDIATE
Diffstat (limited to 'src/implicit.c')
-rw-r--r--src/implicit.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/implicit.c b/src/implicit.c
index c65aec66..fef51fe1 100644
--- a/src/implicit.c
+++ b/src/implicit.c
@@ -963,13 +963,7 @@ pattern_search (struct file *file, int archive,
struct file *imf = pat->file;
struct file *f = lookup_file (imf->name);
- /* We don't want to delete an intermediate file that happened
- to be a prerequisite of some (other) target. Mark it as
- secondary. We don't want it to be precious as that disables
- DELETE_ON_ERROR etc. */
- if (f != 0)
- f->secondary = 1;
- else
+ if (!f)
f = enter_file (imf->name);
f->deps = imf->deps;
@@ -984,8 +978,9 @@ pattern_search (struct file *file, int archive,
f->pat_searched = imf->pat_searched;
f->also_make = imf->also_make;
f->is_target = 1;
+ f->is_explicit |= imf->is_explicit || pat->is_explicit;
f->notintermediate |= imf->notintermediate;
- f->intermediate |= !(pat->is_explicit || f->notintermediate);
+ f->intermediate |= !f->is_explicit && !f->notintermediate;
f->tried_implicit = 1;
imf = lookup_file (pat->pattern);