gpt4 book ai didi

linux - 永久设置 make 使用的线程数

转载 作者:太空宇宙 更新时间:2023-11-04 05:43:00 27 4
gpt4 key购买 nike

当我想在 Linux 中使用 make 命令进行编译时,我总是使用 -j9 运行它来设置要使用的线程数。有没有办法将其永久设置在环境路径或.bashrc文件或任何其他方式中?

最佳答案

您可以设置带有额外标志的 GNUMAKEFLAGS 环境变量以传递给 GNU make,例如:

export GNUMAKEFLAGS=-j9

在 shell 启动脚本中。

GNUMAKEFLAGS

Other flags parsed by make. You can set this in the environment or a makefile to set make command-line flags. GNU make never sets this variable itself. This variable is only needed if you’d like to set GNU make-specific flags in a POSIX-compliant makefile. This variable will be seen by GNU make and ignored by other make implementations. It’s not needed if you only use GNU make; just use MAKEFLAGS directly.

关于linux - 永久设置 make 使用的线程数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41098627/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com