[] Makefile Makefile automatic variable $ @, $ ^, $ <, etc.

The so-called automated variable, the variable is a series of documents that will "model" as defined automatically taken out one by one, until all the documents are in line with patterns take over. This automated variable should only appear in the command rule.

$ @
Target file representation rule set. In the model rules, if there are multiple targets, then "$ @" is to match the set target schema definitions.
Generally used: represents a target file;

$ ^
All dependent on the set goals. Separated by a space. If there are several duplicate in dependence target, that this variable will remove duplicate dependent on target, leaving only one.

$ +
Variable like "$ ^", is all dependent on the target collection. It does not just remove duplicate dependencies goal.

$ <
Relies first goal in the name of the target. If the target is dependent mode (ie, "%") is defined, then the "$ <" is in line with the pattern of a series of file sets. Note that it is taken out one by one.
Generally used: represents a file dependency;

$?
All collections than the target goal of new dependencies. Separated by a space.

$%
Only if the target is a library file, representing the target member name rules. For example, if a goal is "foo.a (bar.o)", then "$%" is "bar.o", "$ @" is "foo.a". If the target is not a library file (for Unix [.a], under Windows is [.lib]), then its value is empty.

 

Guess you like

Origin www.cnblogs.com/utank/p/11842143.html