Makefile中的 Automatic Variables 含义

本文详细介绍了Makefile中常用的特殊变量,包括目标文件名、依赖项等,并解释了这些变量的作用及使用场景。对于理解Makefile的工作原理及进行高效的构建配置具有重要的参考价值。

$@    The filename representing the target.

$%    The filename element of an archive member specification.

$<    The filename of the first prerequisite.

$?    The names of all prerequisites that are newer than the target, separated by spaces.

$^    The filenames of all the prerequisites, separated by spaces. This list has duplicate filenames removed since for most uses, such as compiling, copying, etc., duplicates are not wanted.

$+    Similar to $^, this is the names of all the prerequisites separated by spaces, except that $+ includes duplicates. This variable was created for specific situations such as arguments to linkers where duplicate values have meaning.

$*    The stem of the target filename. A stem is typically a filename without its suffix. (We’ll discuss how stems are computed later in the section “Pattern Rules.”) Its use outside of pattern rules is discouraged.

转载于:https://www.cnblogs.com/whos/archive/2010/09/20/1831679.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值