【问题标题】:GNU make - depend only on file existence and not modification timeGNU make - 仅取决于文件存在而不是修改时间
【发布时间】:2015-08-26 00:53:19
【问题描述】:

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

【问题讨论】:

    标签: linux build makefile dependencies gnu-make


    【解决方案1】:

    你想要一个order-only prerequisite

    但是,有时您会遇到这样的情况,即您希望对要调用的规则施加特定的顺序,而不是在执行这些规则之一时强制更新目标。在这种情况下,您需要定义仅限订单的先决条件。

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

    【讨论】:

    • Clearmake(clearcase make)不支持“order-only-prerequisites”,但这可能不会打扰@tohava。无论如何,我很久以前在使用 clearmake 时遇到了麻烦。
    • @chatraed 这个问题被标记为gnu-make 或者我会在答案中添加这个警告,但仍然很方便指出。
    猜你喜欢
    • 2019-02-19
    • 1970-01-01
    • 1970-01-01
    • 2011-03-06
    • 1970-01-01
    • 1970-01-01
    • 2021-04-09
    • 2018-05-06
    • 2016-01-03
    相关资源
    最近更新 更多