【发布时间】:2020-07-20 15:28:15
【问题描述】:
我正在将 Makefile 从 omake.exe(来自 ClearCase)迁移到 jom.exe/nmake.exe。
一个简化的 Makefile 示例:
all: bin1 bin2
rule1 rule2: rule3
@echo creating rule1 and rule2
@touch rule1 rule2
rule3:
@echo creating rule3
@touch rule3
bin1: rule1
@echo creating bin1
@touch bin1
bin2: rule2
@echo creating bin2
@touch bin2
touch 只是创建一个文件,或者如果它已经存在,它会更新时间戳。
jom/namke 的输出是:
creating rule3
creating rule1 and rule2
creating rule1 and rule2
creating bin1
creating bin2
创建规则1和规则2执行两次。
使用 omake,规则只执行一次,意思是在一个命令中创建文件 rule1 和 rule2(此处为 touch)。
同时创建 rule1 和 rule2 的命令只被调用一次,我有什么需要改变的?
谢谢 泰迪熊
【问题讨论】: