summaryrefslogtreecommitdiff
path: root/src/filedef.h
diff options
context:
space:
mode:
authorDmitry Goncharov <dgoncharov@users.sf.net>2021-09-07 00:08:27 -0400
committerPaul Smith <psmith@gnu.org>2021-09-07 01:14:20 -0400
commit9e4b3d3f4c8241a2c3cd66e1a7695befa5a6a0aa (patch)
tree57d940970aefe3e884095eaa7c273038a7940800 /src/filedef.h
parent5a96d5a066e86178886b80ad00130faf1cc079bf (diff)
downloadmake-git-9e4b3d3f4c8241a2c3cd66e1a7695befa5a6a0aa.tar.gz
[SV 60435] Ensure intermediate grouped files are removed
If multiple intermediate files are built together be sure all of them are removed after make is finished. Continue to ensure that targets that exist before make starts are not removed even if they appear to be intermediate. Add a number of tests to pattern rules to verify this behavior. * src/filedef.h (struct file): Add a new is_explicit bitfield. * src/file.c (rehash_file): Merge the is_explicit bit. (enter_prereqs): Set is_explicit if the file is explicitly mentioned. * src/implicit.c (pattern_search): Set intermediate on the file if it's not explicit. (record_files): Set is_explicit if a file is mentioned as a target. * src/remake.c (update_file_1): Set secondary on files that already exist so they won't be removed. * tests/scripts/features/double_colon: Add a test for double-colon pattern rules. * tests/scripts/features/patternrules: Update KGO for tests where more files are removed. Add new tests to verify handling removal of intermediate files in the context of grouped pattern targets.
Diffstat (limited to 'src/filedef.h')
-rw-r--r--src/filedef.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/filedef.h b/src/filedef.h
index 36701b76..0b9f6e17 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -96,6 +96,7 @@ struct file
unsigned int phony:1; /* Nonzero if this is a phony file
i.e., a prerequisite of .PHONY. */
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
+ unsigned int is_explicit:1; /* Nonzero if explicitly mentioned. */
unsigned int secondary:1; /* Nonzero means remove_intermediates should
not delete it. */
unsigned int notintermediate:1; /* Nonzero means a file is a prereq to