海湾合作委员会制造文件和平行建筑物

发布于 2025-02-01 00:03:31 字数 243 浏览 2 评论 0原文

我需要在“制造文件”中拾取用于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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Hello爱情风 2025-02-08 00:03:31

已经解决了

gnu make:检查并行作业数量

numproc = $ (patsubst -j%,%,$(filter -j%,$(makeflags)))

already solved in

GNU Make: Check number of parallel jobs

NUMPROC = $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))

零度° 2025-02-08 00:03:31

@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文