看例子:
.SECONDEXPANSION:ONE=onefileTWO=twofilemyfile: $(ONE) $$(TWO) echo "myfile"onefile: echo "onefile"twofile: echo "twofile"
执行结果:
onefile
twofile
myfile
如果把 .SECONDEXPANSION: 一行去掉:
#.SECONDEXPANSION:ONE=onefileTWO=twofilemyfile: $(ONE) $$(TWO) echo "myfile"onefile: echo "onefile"twofile: echo "twofile"
运行时显示:
make: *** No rule to make target '$(TWO)', needed by 'myfile'. Stop.
这基本说明了 .SECONDEXPANSION: 的作用。