Variables
Table of Contents
- Pass additional variables from command line
- Automatic Variables(
$@
,$<
, etc…) - Tweak variables for a specific rule
Pass additional variables from command line howto
An argument that contains
=
specifies the value of a variable:v=x
sets the value of the variablev
tox
. If you specify a value in this way, all ordinary assignments of the same variable in the makefile are ignored; we say they have been overridden by the command line argument.
Automatic Variables($@
, $<
, etc…) reference
$@ |
The name of the target |
$% |
The target member name (archive) |
$< |
The name of the first prerequisite |
$? |
The names of all the prerequisites that are newer than the target |
$^ |
The names of all the prerequisites(deduplicated) |
$+ |
The names of all the prerequisites |
$| |
The names of all the order-only prerequisites |
$* |
The stem with which an implicit rule matches |
Tweak variables for a specific rule howto
- Use Pattern-specific Variable Values, like
pattern … : variable-assignment
: