96 GNU make
The syntax of the flavor function is:
$(flavor variable)
Note that variable is the name of a variable to inquire about, not a reference to that
variable. Therefore you would not normally use a ‘$’ or parentheses when writing it. (You
can, however, use a variable reference in the name if you want the name not to be a
constant.)
The result of this function is a string that identifies the flavor of the variable variable:
‘undefined’
if variable was never defined.
‘recursive’
if variable is a recursively expanded variable.
‘simple’
if variable is a simply expanded variable.
8.12 Functions That Control Make
These functions control the way make runs. Generally, they are used to provide information
to the user of the makefile or to cause make to stop if some sort of environmental error is
detected.
$(error text...)
Generates a fatal error where the message is text. Note that the error is gen-
erated whenever this function is evaluated. So, if you put it inside a recipe or
on the right side of a recursive variable assignment, it won’t be evaluated until
later. The text will be expanded before the error is generated.
For example,
ifdef ERROR1
$(error error is $(ERROR1))
endif
will generate a fatal error during the read of the makefile if the make variable
ERROR1 is defined. Or,
ERR = $(error found an error!)
.PHONY: err
err: ; $(ERR)
will generate a fatal error while make is running, if the err target is invoked.
$(warning text...)
This function works similarly to the error function, above, except that make
doesn’t exit. Instead, text is expanded and the resulting message is displayed,
but processing of the makefile continues.
The result of the expansion of this function is the empty string.
$(info text...)
This function does nothing more than print its (expanded) argument(s) to stan-
dard output. No makefile name or line number is added. The result of the
expansion of this function is the empty string.
Comentários a estes Manuais