上例子
LIBS=foo.gao bar.gao .INTERMEDIATE:$(LIBS) .SECONDARY:bar.gao all: $(LIBS) #pass foo.gao: @echo $@ touch $@ bar.gao: @echo $@ touch $@
make --dry-run 的结果:
foo.gao
touch foo.gao
bar.gao
touch bar.gao
#pass
rm foo.gao
可见,SECONDARY 确实起到了保护 中间文件的作用
结束