make: Undefine Directive
1
1 6.9 Undefining Variables
1 ========================
1
1 If you want to clear a variable, setting its value to empty is usually
1 sufficient. Expanding such a variable will yield the same result (empty
1 string) regardless of whether it was set or not. However, if you are
DONTPRINTYET 1 using the 'flavor' (⇒Flavor Function) and 'origin' (*noteOrigin
1DONTPRINTYET 1 using the 'flavor' (⇒Flavor Function) and 'origin' (⇒Origin
Function) functions, there is a difference between a variable that was
1 never set and a variable with an empty value. In such situations you
1 may want to use the 'undefine' directive to make a variable appear as if
1 it was never set. For example:
1
1 foo := foo
1 bar = bar
1
1 undefine foo
1 undefine bar
1
1 $(info $(origin foo))
1 $(info $(flavor bar))
1
1 This example will print "undefined" for both variables.
1
1 If you want to undefine a command-line variable definition, you can
1 use the 'override' directive together with 'undefine', similar to how
1 this is done for variable definitions:
1
1 override undefine CFLAGS
1