Chapter 6: How to Use Variables 73
6.14 Other Special Variables
GNU make supports some variables that have special properties.
MAKEFILE_LIST
Contains the name of each makefile that is parsed by make, in the order in
which it was parsed. The name is appended just before make begins to parse
the makefile. Thus, if the first thing a makefile does is examine the last word
in this variable, it will be the name of the current makefile. Once the current
makefile has used include, however, the last word will be the just-included
makefile.
If a makefile named Makefile has this content:
name1 := $(lastword $(MAKEFILE_LIST))
include inc.mk
name2 := $(lastword $(MAKEFILE_LIST))
all:
@echo name1 = $(name1)
@echo name2 = $(name2)
then you would expect to see this output:
name1 = Makefile
name2 = inc.mk
.DEFAULT_GOAL
Sets the default goal to be used if no targets were specified on the command line
(see Section 9.2 [Arguments to Specify the Goals], page 99). 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:
Comentarios a estos manuales