DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(make.info.gz) Special Variables

Info Catalog (make.info.gz) MAKEFILE_LIST Variable (make.info.gz) Makefiles (make.info.gz) Remaking Makefiles
 
 3.6 Other Special Variables
 ===========================
 
 GNU `make' also supports other special variables.  Unless otherwise
 documented here, these values lose their special properties if they are
 set by a makefile or on the command line.
 
 `.DEFAULT_GOAL'
      Sets the default goal to be used if no targets were specified on
      the command line ( Arguments to Specify the Goals Goals.).
      The `.DEFAULT_GOAL' variable allows you to discover the current
      default goal, restart the default goal selection algorithm by
      clearing its value, or to explicitly set the default goal.  The
      following example illustrates these cases:
 
           # Query the default goal.
           ifeq ($(.DEFAULT_GOAL),)
             $(warning no default goal is set)
           endif
 
           .PHONY: foo
           foo: ; @echo $@
 
           $(warning default goal is $(.DEFAULT_GOAL))
 
           # Reset the default goal.
           .DEFAULT_GOAL :=
 
           .PHONY: bar
           bar: ; @echo $@
 
           $(warning default goal is $(.DEFAULT_GOAL))
 
           # Set our own.
           .DEFAULT_GOAL := foo
 
      This makefile prints:
 
           no default goal is set
           default goal is foo
           default goal is bar
           foo
 
      Note that assigning more than one target name to `.DEFAULT_GOAL' is
      illegal and will result in an error.
 
 `MAKE_RESTARTS'
      This variable is set only if this instance of `make' has restarted
      ( How Makefiles Are Remade Remaking Makefiles.): it will
      contain the number of times this instance has restarted.  Note
      this is not the same as recursion (counted by the `MAKELEVEL'
      variable).  You should not set, modify, or export this variable.
 
 `.VARIABLES'
      Expands to a list of the _names_ of all global variables defined
      so far.  This includes variables which have empty values, as well
      as built-in variables ( Variables Used by Implicit Rules
      Implicit Variables.), but does not include any variables which are
      only defined in a target-specific context.  Note that any value
      you assign to this variable will be ignored; it will always return
      its special value.
 
 `.FEATURES'
      Expands to a list of special features supported by this version of
      `make'.  Possible values include:
 
     `archives'
           Supports `ar' (archive) files using special filename syntax.
            Using `make' to Update Archive Files Archives.
 
     `check-symlink'
           Supports the `-L' (`--check-symlink-times') flag.  
           Summary of Options Options Summary.
 
     `else-if'
           Supports "else if" non-nested conditionals.   Syntax of
           Conditionals Conditional Syntax.
 
     `jobserver'
           Supports "job server" enhanced parallel builds.  
           Parallel Execution Parallel.
 
     `second-expansion'
           Supports secondary expansion of prerequisite lists.
 
     `order-only'
           Supports order-only prerequisites.   Types of
           Prerequisites Prerequisite Types.
 
     `target-specific'
           Supports target-specific and pattern-specific variable
           assignments.   Target-specific Variable Values
           Target-specific.
 
 
 `.INCLUDE_DIRS'
      Expands to a list of directories that `make' searches for included
      makefiles ( Including Other Makefiles Include.).
 
 
Info Catalog (make.info.gz) MAKEFILE_LIST Variable (make.info.gz) Makefiles (make.info.gz) Remaking Makefiles
automatically generated byinfo2html