开发者

what does $< and $@ mean in make file

I found these pseudo variable name i开发者_运维知识库n my makefile in WDK build environment. What is referenced by these variables? It is a little hard for me to get the answer by search engine because they are special, I believe.


These are automatic variables:

$@ The file name of the target of the rule. If the target is an archive member, then ‘$@’ is the name of the archive file. In a pattern rule that has multiple targets (see Introduction to Pattern Rules), ‘$@’ is the name of whichever target caused the rule's recipe to be run.

$< The name of the first prerequisite. If the target got its recipe from an implicit rule, this will be the first prerequisite added by the implicit rule (see Implicit Rules).

They are used to build rules that can be applied to different targets so that one does not need to repeat the same rule for each and every file that must be worked on...

PS: To find the answer, I first looked for the 'all documentation on a single page' for GNU make, then used my browser's search function...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜