gpt4 book ai didi

linux - GNU make - 只依赖于文件存在而不是修改时间

转载 作者:太空宇宙 更新时间:2023-11-04 09:31:38 25 4
gpt4 key购买 nike

我想要一个 makefile,其中我有一个任务 a,它只能在文件 b 存在时运行,但如果 b 则不需要重新运行> 已更新。我该怎么做?

最佳答案

你想要一个 order-only prerequisite :

Occasionally, however, you have a situation where you want to impose a specific ordering on the rules to be invoked without forcing the target to be updated if one of those rules is executed. In that case, you want to define order-only prerequisites.

请注意,并非所有版本的 make 都支持这一点。

关于linux - GNU make - 只依赖于文件存在而不是修改时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30761959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com