Makefile 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, '$@' is the name of  whichever target caused the rule's recipe to be run.

$%:

The target member name, when the target is an archive name. '$%' is empty when the target is not an archive member.

$<:

The name of the first prerequisite. If the target got its recipe from an implicit rule, this will the first prerequisite added by the implicit rule.

$?:

The name of all prerequisites that are newer than the target, with spaces between them. For prerequisites which are archive members, only the named member are used.

$^:

The names of all the prerequisites, with spaces between them. For prerequisites which are archive members, only the named member is used.

A target has only one prerequisite on each other file it depends on, no matter how many times each file is listed as a prerequisite. So if you list a prerequisite more than once

for a target, the value of $^ contains just one copy of the name. This list does not contain any of the order-only prerequisites; for those see the ‘$|’ variable, below.

$+:

This is like ‘$^’, but prerequisites listed more than once are duplicated in the order they were listed in the makefile. This is primarily useful for use in linking commands

where it is meaningful to repeat library file names in a particular order.

$|:

The names of all the order-only prerequisites, with spaces between them.

$*:

The stem with which an implicit rule matches (see Section 10.5.4 [How Patterns Match], page 114). If the target is ‘dir/a.foo.b’ and the target pattern is ‘a.%.b’ then the stem is ‘dir/foo’. The stem is useful for constructing names of related files.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值