无法与 Gnu Make 4.3(MinGW-w64 端口)并行运行目标子集

问题描述 投票:0回答:1

考虑以下 makefile:

.DEFAULT_GOAL := all

.PHONY: all
all: target0 target1 target2

# This line makes all targets run serially
#.NOTPARALLEL: target0

.PHONY: target0
target0:
    @python delayed_print.py 0

.PHONY: target1
target1:
    @python delayed_print.py 1
    
.PHONY: target2
target2:
    @python delayed_print.py 2

delayed_print.py 只是一个小的 Python 脚本,它会在几秒钟后打印参数,这样我就可以轻松地看到并行运行的内容。

默认情况下(mingw32-make 使用 -j 选项),Make 并行运行所有目标。如果我启用 .NOTPARALLEL 行,则所有目标都会串行运行。这是一个错误吗?我是不是做错了什么?

我的目的是并行运行目标的子集并强制顺序执行某些目标。

供参考:

mingw32-make --version
GNU Make 4.3
Built for Windows32
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
makefile concurrency parallel-processing gnu-make mingw-w64
1个回答
2
投票

GNU Make 4.4 中添加了向

.NOTPARALLEL
指定特定目标的功能以及
.WAIT
特殊目标。

查看新闻文件:https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.4.1#n137

© www.soinside.com 2019 - 2024. All rights reserved.