Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个目标,它需要几个输入文件并生成一个。
现在我忽略输入文件的新鲜状态并将其作为 .PHONY 运行
file.out: $(CMD) input/* file.out
我想要类似的东西:
file.out: $(wildcard input/*) $(CMD) $^ $@
...因此,每次输入未更改时,make 都不会运行 CMD。
删除 .PHONY 目标。
CMD := cat file.out: $(wildcard input/*) $(CMD) $^ > $@