32 GNU make
4.8 Special Built-in Target Names
Certain names have special meanings if they appear as targets.
.PHONY
The prerequisites of the special target .PHONY are considered to be phony tar-
gets. When it is time to consider such a target, make will run its recipe un-
conditionally, regardless of whether a file with that name exists or what its
last-modification time is. See Section 4.5 [Phony Targets], page 29.
.SUFFIXES
The prerequisites of the special target .SUFFIXES are the list of suffixes to be
used in checking for suffix rules. See Section 10.7 [Old-Fashioned Suffix Rules],
page 125.
.DEFAULT
The recipe specified for .DEFAULT is used for any target for which no rules are
found (either explicit rules or implicit rules). See Section 10.6 [Last Resort],
page 125. If a .DEFAULT recipe is specified, every file mentioned as a prerequi-
site, but not as a target in a rule, will have that recipe executed on its behalf.
See Section 10.8 [Implicit Rule Search Algorithm], page 127.
.PRECIOUS
The targets which .PRECIOUS depends on are given the following special treat-
ment: if make is killed or interrupted during the execution of their recipes, the
target is not deleted. See Section 5.6 [Interrupting or Killing make], page 50.
Also, if the target is an intermediate file, it will not be deleted after it is no
longer needed, as is normally done. See Section 10.4 [Chains of Implicit Rules],
page 117. In this latter respect it overlaps with the .SECONDARY special target.
You can also list the target pattern of an implicit rule (such as ‘%.o’) as a
prerequisite file of the special target .PRECIOUS to preserve intermediate files
created by rules whose target patterns match that file’s name.
.INTERMEDIATE
The targets which .INTERMEDIATE depends on are treated as intermediate files.
See Section 10.4 [Chains of Implicit Rules], page 117. .INTERMEDIATE with no
prerequisites has no effect.
.SECONDARY
The targets which .SECONDARY depends on are treated as intermediate files,
except that they are never automatically deleted. See Section 10.4 [Chains of
Implicit Rules], page 117.
.SECONDARY with no prerequisites causes all targets to be treated as secondary
(i.e., no target is removed because it is considered intermediate).
.SECONDEXPANSION
If .SECONDEXPANSION is mentioned as a target anywhere in the makefile, then
all prerequisite lists defined after it appears will be expanded a second time
after all makefiles have been read in. See Section 3.8 [Secondary Expansion],
page 18.
Kommentare zu diesen Handbüchern