diff options
author | Paul Smith <psmith@gnu.org> | 2022-08-03 00:13:34 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-08-03 00:13:34 -0400 |
commit | c72e1ec44673e89fceab4cc9a672f38aeb83abbc (patch) | |
tree | 6830985ec30fcfcb2bc3c2b2ddebfb021a8cdf7b /doc | |
parent | 91d87ccf321c16eb48531e39ba103878c15dafd1 (diff) | |
download | make-git-c72e1ec44673e89fceab4cc9a672f38aeb83abbc.tar.gz |
* doc/make.texi (Chained Rules): [SV 61957] Clarify NOTINTERMEDIATE
Diffstat (limited to 'doc')
-rw-r--r-- | doc/make.texi | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/doc/make.texi b/doc/make.texi index efd70306..6dd9a8e8 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -10301,18 +10301,21 @@ longer needed. Therefore, an intermediate file which did not exist before deletion to you by printing a @samp{rm} command showing which file it is deleting. -Ordinarily, a file cannot be intermediate if it is mentioned in the -makefile as a target or prerequisite. However, you can explicitly mark a -file as intermediate by listing it as a prerequisite of the special target -@code{.INTERMEDIATE}. This takes effect even if the file is mentioned -explicitly in some other way. - -Listing a file as a prerequisite of the special target -@code{.NOTINTERMEDIATE} forces it to not be considered intermediate -(just as any other mention of the file will do). Also, listing the -target pattern of a pattern rule as a prerequisite of -@code{.NOTINTERMEDIATE} ensures that no targets generated using that -pattern rule are considered intermediate. +You can explicitly mark a file as intermediate by listing it as a prerequisite +of the special target @code{.INTERMEDIATE}. This takes effect even if the +file is mentioned explicitly in some other way. + +A file cannot be intermediate if it is mentioned in the makefile as a target +or prerequisite, so one way to avoid the deletion of intermediate files is by +adding it as a prerequisite to some target. However, doing so can cause make +to do extra work when searching pattern rules (@pxref{Implicit Rule Search, +,Implicit Rule Search Algorithm}). + +As an alternative, listing a file as a prerequisite of the special target +@code{.NOTINTERMEDIATE} forces it to not be considered intermediate (just as +any other mention of the file will do). Also, listing the target pattern of a +pattern rule as a prerequisite of @code{.NOTINTERMEDIATE} ensures that no +targets generated using that pattern rule are considered intermediate. You can disable intermediate files completely in your makefile by providing @code{.NOTINTERMEDIATE} as a target with no prerequisites: |