LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 804|回复: 1

一个关于Make的问题,看文档没怎么明白

[复制链接]
发表于 2007-7-6 13:17:01 | 显示全部楼层 |阅读模式
在看Makefile的二次扩展中,有这么一个例子:
.SECONDEXPANSION:
foo: foo.1 bar.1 $$< $$^ $$+ # line #1
foo: foo.2 bar.2 $$< $$^ $$+ # line #2
foo: foo.3 bar.3 $$< $$^ $$+ # line #3

make的手册说二次扩展的结果为:
In the first prerequisite list, all three variables ($$<, $$^, and $$+) expand to the empty string. In the second, they will have values foo.1, foo.1 bar.1, and foo.1 bar.1 respectively.  In the third they will have values foo.1, foo.1 bar.1 foo.2 bar.2, and foo.1 bar.1 foo.2 bar.2 respectively.

为什么在第一行里面扩展字符都为空啊?


BTW:
The $$< variable evaluates to the first prerequisite in the first rule for this target. $$^ and $$+ evaluate to the list of all prerequisites of rules that have already appeared for the same target ($$+ with repetitions and $$^ without).
 楼主| 发表于 2007-7-6 14:17:52 | 显示全部楼层
已经搞定,
没仔细看$$@和其他几个的定义, 他们的定义比较诡异
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表