]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 60297] Add .NOTINTERMEDIATE special target
authorDmitry Goncharov <dgoncharov@users.sf.net>
Sun, 30 May 2021 17:48:29 +0000 (13:48 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 25 Jul 2021 21:15:38 +0000 (17:15 -0400)
commit33468b3f31d65815152c11f32dc5c4384a6267b5
treedd6ea8bec02ce9b16af732d0a229b7e74e63d75e
parent1cffd0a203bc1477671a02aafd6360b7bb964670
[SV 60297] Add .NOTINTERMEDIATE special target

Support a new special target, .NOTINTERMEDIATE.  Any file or pattern
prerequisite of this target will never be considered intermediate.
This differs from .SECONDARY in that .SECONDARY files won't be deleted
but they will still not be built if they are missing.

.NOTINTERMEDIATE files are treated the same way as a target which is
explicitly mentioned in the makefile.  This is mostly useful with
patterns; obviously mentioning a target explicitly here is enough in
and of itself to make something not intermediate.

Some adjustments made by psmith@gnu.org

* NEWS: Announce the new feature.
* doc/make.texi (Special Targets): Document .NOTINTERMEDIATE.
(Chained Rules): Describe how to use .NOTINTERMEDIATE.
* src/main.c (main): Add "notintermediate" to the .FEATURES variable.
* src/filedef.h (struct file): Add "notintermediate" flag.
* src/file.c (no_intermediates): Mark global .NOTINTERMEDIATE.
(snap_file): Support .NOTINTERMEDIATE special target.  Throw an error
if the same target is marked both .NOTINTERMEDIATE and .SECONDARY or
.INTERMEDIATE.
(rehash_file): Merge intermediate, notintermediate, secondary flags.
(remove_intermediates): Check notintermediate flag before removing.
(print_file):
* src/implicit.c (pattern_search): Set notintermediate based on the
pattern.
* tests/scripts/targets/NOTINTERMEDIATE: Add a new test suite.
NEWS
doc/make.texi
src/file.c
src/filedef.h
src/implicit.c
src/main.c
tests/scripts/targets/NOTINTERMEDIATE [new file with mode: 0644]