]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 60435] Ensure intermediate grouped files are removed
authorDmitry Goncharov <dgoncharov@users.sf.net>
Tue, 7 Sep 2021 04:08:27 +0000 (00:08 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 7 Sep 2021 05:14:20 +0000 (01:14 -0400)
commit9e4b3d3f4c8241a2c3cd66e1a7695befa5a6a0aa
tree57d940970aefe3e884095eaa7c273038a7940800
parent5a96d5a066e86178886b80ad00130faf1cc079bf
[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.
doc/make.texi
src/file.c
src/filedef.h
src/implicit.c
src/read.c
src/remake.c
tests/scripts/features/double_colon
tests/scripts/features/patternrules