上例子

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 确实起到了保护 中间文件的作用

结束

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-07-29
  • 2021-09-27
  • 2021-04-18
  • 2021-07-19
  • 2021-07-26
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案