make: Make Control Functions
1
1 8.12 Functions That Control Make
1 ================================
1
1 These functions control the way make runs. Generally, they are used to
1 provide information to the user of the makefile or to cause make to stop
1 if some sort of environmental error is detected.
1
1 '$(error TEXT...)'
1 Generates a fatal error where the message is TEXT. Note that the
1 error is generated whenever this function is evaluated. So, if you
1 put it inside a recipe or on the right side of a recursive variable
1 assignment, it won't be evaluated until later. The TEXT will be
1 expanded before the error is generated.
1
1 For example,
1
1 ifdef ERROR1
1 $(error error is $(ERROR1))
1 endif
1
1 will generate a fatal error during the read of the makefile if the
1 'make' variable 'ERROR1' is defined. Or,
1
1 ERR = $(error found an error!)
1
1 .PHONY: err
1 err: ; $(ERR)
1
1 will generate a fatal error while 'make' is running, if the 'err'
1 target is invoked.
1
1 '$(warning TEXT...)'
1 This function works similarly to the 'error' function, above,
1 except that 'make' doesn't exit. Instead, TEXT is expanded and the
1 resulting message is displayed, but processing of the makefile
1 continues.
1
1 The result of the expansion of this function is the empty string.
1
1 '$(info TEXT...)'
1 This function does nothing more than print its (expanded)
1 argument(s) to standard output. No makefile name or line number is
1 added. The result of the expansion of this function is the empty
1 string.
1