看例子:
复制代码
.SECONDEXPANSION:
ONE=onefile
TWO=twofile
myfile: $(ONE) $$(TWO)
echo "myfile"
onefile:
echo "onefile"
twofile:
echo "twofile"
复制代码
执行结果:
onefile
twofile
myfile
如果把 .SECONDEXPANSION: 一行去掉:
复制代码
#.SECONDEXPANSION:
ONE=onefile
TWO=twofile
myfile: $(ONE) $$(TWO)
echo "myfile"
onefile:
echo "onefile"
twofile:
echo "twofile"
复制代码
运行时显示:
make: *** No rule to make target '$(TWO)', needed by 'myfile'. Stop.
这基本说明了 .SECONDEXPANSION: 的作用。
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/17/2688535.html,如需转载请自行联系原作者