Make
Automatic variables
$@ The name of the target
$< The name of the first prerequisite
$? The names of all the prerequisites that are newer than the target
$^ The names of all the prerequisites
$* The stem with which the rule matches
Valid only in recipes, they are undefined in targets or prerequisites [1] .
Examples
target: requisite1 requisite2 requisite3
requisite3
is the only prerequisite newer than target
. In the
recipe for this rule:
‘$@’ is target
‘$<’ is requisite1
‘$?’ is requisite3
‘$^’ is requisite1 requisite2 requisite3
file.zip: a b c
zip -r $@ $?
Only those files newer than file.zip will be replaced, or added if they don’t exist in file.zip.
References
- Make > Using Implicit Rules > Defining and Redefining Pattern Rules > 10.5.3 Automatic Variables