Makefile 的 prequisite 執行順序 single multi thread

Makefile 代碼以下:
B 須要 A 的 產出,ui

all: A B

A B 是 target,code

case 1:
single-thread
make -j1
則執行的順序為 A -> B
A 先產出,B 再消化。get

case 2:
multi-thread
make -j16
則執行的順序為平行 A->
B->
A 還沒有產出 B 所須要的東西,
B 就向去拿,會發生 error,io

解法:
Makefileclass

all: A

A:
    $(MAKE) B

https://stackoverflow.com/questions/8496135/parallel-makefile-requires-dependency-orderingthread

相關文章
相關標籤/搜索