gpt4 book ai didi

makefile - Makefile 规则定义中的分号

转载 作者:行者123 更新时间:2023-12-03 20:27:55 25 4
gpt4 key购买 nike

我在 Makefile 中看到许多规则,如下所示:

$(PATH)/foo.inc:;
include $(PATH)/foo.inc

$(PATH)/bar.inc:;
include $(PATH)/bar.inc

规则定义末尾的分号是空操作还是具有特定含义?

最佳答案

带有目标先决条件的行上的分号是为此规则执行的第一个命令行,至少在 GNU make 中是这样。

从手册的第 5 章:

The commands of a rule consist of shell command lines to be executed one by one. Each command line must start with a tab, except that the first command line may be attached to the target-and-prerequisites line with a semicolon in between.



在您的情况下,由于分号后没有命令,因此它最终成为无操作。

关于makefile - Makefile 规则定义中的分号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12322823/

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