【发布时间】:2010-01-23 01:07:45
【问题描述】:
我的第一个问题(耶!)是关于 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 的命令三次。我希望这是有道理的。感谢您的任何建议或想法!
【问题讨论】:
-
它确实似乎按照我想要的方式工作,但是这种并行构建的东西有一种根据系统负载或机器到机器等来改变行为的方法。
标签: makefile parallel-processing gnu-make