我在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.
在你的情况下,因为在分号之后没有命令,所以它最终是一个无操作的.