make: Special Targets

1 
1 4.9 Special Built-in Target Names
1 =================================
1 
1 Certain names have special meanings if they appear as targets.
1 
1 '.PHONY'
1 
1      The prerequisites of the special target '.PHONY' are considered to
1      be phony targets.  When it is time to consider such a target,
1      'make' will run its recipe unconditionally, regardless of whether a
1      file with that name exists or what its last-modification time is.
1      ⇒Phony Targets Phony Targets.
1 
1 '.SUFFIXES'
1 
1      The prerequisites of the special target '.SUFFIXES' are the list of
11      suffixes to be used in checking for suffix rules.  ⇒
      Old-Fashioned Suffix Rules Suffix Rules.
1 
1 '.DEFAULT'
1 
1      The recipe specified for '.DEFAULT' is used for any target for
1      which no rules are found (either explicit rules or implicit rules).
1      ⇒Last Resort.  If a '.DEFAULT' recipe is specified, every
1      file mentioned as a prerequisite, but not as a target in a rule,
11      will have that recipe executed on its behalf.  ⇒Implicit Rule
      Search Algorithm Implicit Rule Search.
1 
1 '.PRECIOUS'
1 
1      The targets which '.PRECIOUS' depends on are given the following
1      special treatment: if 'make' is killed or interrupted during the
11      execution of their recipes, the target is not deleted.  ⇒
      Interrupting or Killing 'make' Interrupts.  Also, if the target is
1      an intermediate file, it will not be deleted after it is no longer
11      needed, as is normally done.  ⇒Chains of Implicit Rules
      Chained Rules.  In this latter respect it overlaps with the
1      '.SECONDARY' special target.
1 
1      You can also list the target pattern of an implicit rule (such as
1      '%.o') as a prerequisite file of the special target '.PRECIOUS' to
1      preserve intermediate files created by rules whose target patterns
1      match that file's name.
1 
1 '.INTERMEDIATE'
1 
1      The targets which '.INTERMEDIATE' depends on are treated as
1      intermediate files.  ⇒Chains of Implicit Rules Chained Rules.
1      '.INTERMEDIATE' with no prerequisites has no effect.
1 
1 '.SECONDARY'
1 
1      The targets which '.SECONDARY' depends on are treated as
1      intermediate files, except that they are never automatically
1      deleted.  ⇒Chains of Implicit Rules Chained Rules.
1 
1      '.SECONDARY' with no prerequisites causes all targets to be treated
1      as secondary (i.e., no target is removed because it is considered
1      intermediate).
1 
1 '.SECONDEXPANSION'
1 
1      If '.SECONDEXPANSION' is mentioned as a target anywhere in the
1      makefile, then all prerequisite lists defined _after_ it appears
1      will be expanded a second time after all makefiles have been read
1      in.  ⇒Secondary Expansion Secondary Expansion.
1 
1 '.DELETE_ON_ERROR'
1 
1      If '.DELETE_ON_ERROR' is mentioned as a target anywhere in the
1      makefile, then 'make' will delete the target of a rule if it has
1      changed and its recipe exits with a nonzero exit status, just as it
1      does when it receives a signal.  ⇒Errors in Recipes Errors.
1 
1 '.IGNORE'
1 
1      If you specify prerequisites for '.IGNORE', then 'make' will ignore
1      errors in execution of the recipe for those particular files.  The
1      recipe for '.IGNORE' (if any) is ignored.
1 
1      If mentioned as a target with no prerequisites, '.IGNORE' says to
1      ignore errors in execution of recipes for all files.  This usage of
1      '.IGNORE' is supported only for historical compatibility.  Since
1      this affects every recipe in the makefile, it is not very useful;
1      we recommend you use the more selective ways to ignore errors in
1      specific recipes.  ⇒Errors in Recipes Errors.
1 
1 '.LOW_RESOLUTION_TIME'
1 
1      If you specify prerequisites for '.LOW_RESOLUTION_TIME', 'make'
1      assumes that these files are created by commands that generate low
1      resolution time stamps.  The recipe for the '.LOW_RESOLUTION_TIME'
1      target are ignored.
1 
1      The high resolution file time stamps of many modern file systems
1      lessen the chance of 'make' incorrectly concluding that a file is
1      up to date.  Unfortunately, some hosts do not provide a way to set
1      a high resolution file time stamp, so commands like 'cp -p' that
1      explicitly set a file's time stamp must discard its sub-second
1      part.  If a file is created by such a command, you should list it
1      as a prerequisite of '.LOW_RESOLUTION_TIME' so that 'make' does not
1      mistakenly conclude that the file is out of date.  For example:
1 
1           .LOW_RESOLUTION_TIME: dst
1           dst: src
1                   cp -p src dst
1 
1      Since 'cp -p' discards the sub-second part of 'src''s time stamp,
1      'dst' is typically slightly older than 'src' even when it is up to
1      date.  The '.LOW_RESOLUTION_TIME' line causes 'make' to consider
1      'dst' to be up to date if its time stamp is at the start of the
1      same second that 'src''s time stamp is in.
1 
1      Due to a limitation of the archive format, archive member time
1      stamps are always low resolution.  You need not list archive
1      members as prerequisites of '.LOW_RESOLUTION_TIME', as 'make' does
1      this automatically.
1 
1 '.SILENT'
1 
1      If you specify prerequisites for '.SILENT', then 'make' will not
1      print the recipe used to remake those particular files before
1      executing them.  The recipe for '.SILENT' is ignored.
1 
1      If mentioned as a target with no prerequisites, '.SILENT' says not
1      to print any recipes before executing them.  This usage of
1      '.SILENT' is supported only for historical compatibility.  We
1      recommend you use the more selective ways to silence specific
1      recipes.  ⇒Recipe Echoing Echoing.  If you want to silence
1      all recipes for a particular run of 'make', use the '-s' or
1      '--silent' option (⇒Options Summary).
1 
1 '.EXPORT_ALL_VARIABLES'
1 
1      Simply by being mentioned as a target, this tells 'make' to export
11      all variables to child processes by default.  ⇒Communicating
      Variables to a Sub-'make' Variables/Recursion.
1 
1 '.NOTPARALLEL'
1 
1      If '.NOTPARALLEL' is mentioned as a target, then this invocation of
1      'make' will be run serially, even if the '-j' option is given.  Any
1      recursively invoked 'make' command will still run recipes in
1      parallel (unless its makefile also contains this target).  Any
1      prerequisites on this target are ignored.
1 
1 '.ONESHELL'
1 
1      If '.ONESHELL' is mentioned as a target, then when a target is
1      built all lines of the recipe will be given to a single invocation
11      of the shell rather than each line being invoked separately (⇒
      Recipe Execution Execution.).
1 
1 '.POSIX'
1 
1      If '.POSIX' is mentioned as a target, then the makefile will be
1      parsed and run in POSIX-conforming mode.  This does _not_ mean that
1      only POSIX-conforming makefiles will be accepted: all advanced GNU
1      'make' features are still available.  Rather, this target causes
1      'make' to behave as required by POSIX in those areas where 'make''s
1      default behavior differs.
1 
1      In particular, if this target is mentioned then recipes will be
1      invoked as if the shell had been passed the '-e' flag: the first
1      failing command in a recipe will cause the recipe to fail
1      immediately.
1 
1    Any defined implicit rule suffix also counts as a special target if
1 it appears as a target, and so does the concatenation of two suffixes,
1 such as '.c.o'.  These targets are suffix rules, an obsolete way of
1 defining implicit rules (but a way still widely used).  In principle,
1 any target name could be special in this way if you break it in two and
1 add both pieces to the suffix list.  In practice, suffixes normally
1 begin with '.', so these special target names also begin with '.'.
1 ⇒Old-Fashioned Suffix Rules Suffix Rules.
1