海湾合作委员会制造文件和平行建筑物
我需要在“制造文件”中拾取用于Paralell编译的处理器数量。
例如,
make -j32 .....
我需要在makefile内部拿起数字32。
我知道这是在变量makeflag
中进行的,因此我可以对其进行解析,但是还有其他一些变量可以直接提供此信息吗?
例如:
numcpu = 32
I need to pick up in the make file the number of processor used for the paralell compilation.
e.g.
make -j32 .....
I need to pick up the number 32 inside the Makefile.
I know this comes inside the variable MAKEFLAG
so I could parse it, but is there some other variable that gives this information directly?
For example:
NUMCPU = 32
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已经解决了
gnu make:检查并行作业数量
numproc = $ (patsubst -j%,%,$(filter -j%,$(makeflags)))
already solved in
GNU Make: Check number of parallel jobs
NUMPROC = $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))
@DevSolar我也希望不混合制作和忍者构建,但我需要做,该项目是一个涉及多个图书馆和几个团队的大型项目,因此我不能独自一人决定构建过程。
为了解释构建过程,我有一个目标和一些用于构建系统的构建系统/忍者的库和其他使用制造的库。
现在,在官方发布阶段,所有库都必须重新编译,因此首先将其编译为遗留“ Make”,然后是带有Meson和最终的二进制/可执行文件的图书馆,这些二进制/可执行文件将链接到以前的编译库中的Al。
目前,一切都是由命令触发的,生产团队希望使用-J选项以及忍者。
因此,我正在为库提供-J,并使用忍者构建的最终二进制/可执行文件。
@DevSolar me too would like not mix make and ninja build But I need to do,the project is a big project involving several libraries and several teams so I cannot decide alone the build process.
in order to explain the build process I have a target and some libraries that use for the build system meson/ninja and other libraries that use make.
Now during the official release phase all the library must be recompiled, so first are compiled the ones with the legacy "make " and then the ones with meson and the final the binary/executable that will link al of the previous compiled libraries.
At the moment all is triggered by a make command and the production team wants to use the -j option both for make and ninja.
for this reason I am tring to provide the -j to the libraries and final binary/executable built with ninja.