Next: Remaking Makefiles, Previous: MAKEFILE_LIST Variable, Up: Makefiles
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
.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
make
has
restarted (see How Makefiles Are Remade): 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
.FEATURES
make
. Possible values include:
ar
(archive) files using special filename syntax.
See Using make
to Update Archive Files.
-L
(--check-symlink-times
) flag.
See Summary of Options.
.INCLUDE_DIRS
make
searches for
included makefiles (see Including Other Makefiles).