我的第一个问题(耶!)是关于 gnumake 和并行构建的。这是一个简单的示例文件:
.PHONY: tool_1 tool_2 tool_3 tool_4 all tools
all: | tools
tools: | tool_2 tool_3 tool_4
tool_1:
# commands for tool 1
tool_2: | tool_1
# commands for tool 2
tool_3: | tool_1
# commands for tool 3
tool_4: | tool_1
# commands for tool 4
如果我make -j
对这个人这样做,我在这里是否正确确保命令tool_1
只执行一次,然后再make
尝试构建任何tool_[234]
?
我正在寻找的是首先构建的make -j
原因tool_1
,然后tool_[234]
是并行构建,但不执行tool_1
三次命令。我希望这是有道理的。感谢您的任何建议或想法!