Car*_*rum 10 parallel-processing makefile gnu-make
我的第一个问题(耶!)是关于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
Run Code Online (Sandbox Code Playgroud)
如果我make -j对这个人这么做,我在这里是否正确,以确保命令tool_1只执行一次,并在make尝试构建任何之前tool_[234]?
我正在寻找的是首先构建make -j原因tool_1,然后tool_[234]并行构建,但不执行命令tool_1三次.我希望这是有道理的.感谢您的任何建议或想法!
make -j在你的问题中完全按照你的预期行事.它不会多次依赖.
pipe(|)字符在依赖项列表中的作用是什么?
| 归档时间: |
|
| 查看次数: |
7505 次 |
| 最近记录: |