本文介绍了在make中使用PARALLEL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在制作文件,并试图减少它们的编译时间. my代码的结构由各个子目录组成,每个子目录都有自己的makefile.主目录中的子目录似乎是独立的,因为每当我在任何子目录中运行make时,它运行得都很好,并且没有显示任何错误.因此,我想并行运行所有子目录的子make.有可能吗?如果可以,怎么办?
I have been working on makefiles and trying to reduce their compilation time. The structure of the my code consists of various sub directories each having its own makefile. The subdirectories in the main directory seem to be independent as whenever i run make in any of the subdirectories, it runs perfectly fine and shows no error. Thus, i want to run the sub-make for all subdirectories in parallel. Is it possible> and if yes, how?
提前谢谢
推荐答案
这是一种粗略但有效的方法:
Here is a crude but effective method:
SUBDIRS = /something /something/else /another
.PHONY: $(SUBDIRS) all
all: $(SUBDIRS)
$(SUBDIRS):
@$(MAKE) -s -C $@
使用make -j
运行它.
这篇关于在make中使用PARALLEL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!