8.11 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.
Generates a fatal error where the message is text. Note that the
error is generated whenever this function is evaluated. So, if you put
it inside a command script 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.
$(error error is $(ERROR1))
will generate a fatal error during the read of the makefile if the
ERROR1 is defined. Or,
ERR = $(error found an error!)
err: ; $(ERR)
will generate a fatal error while
make is running, if the
err target is invoked.
This function works similarly to the
error function, above,
make doesn't exit. Instead, text is expanded
and the resulting message is displayed, but processing of the makefile
The result of the expansion of this function is the empty string.