Is there any way to have make
use multi-threading (6 threads is ideal on my system) system-wide, instead of by just adding -j6
to the command line? So, that if I run make
, it acts the same as if I was running make -j6
? I want this functionality because I install a lot of packages from the AUR using pacaur
(I'm on Arch), so I don't directly run the make command, but I would still like multi-threading to build packages faster.
Use multi-threaded make by default
command linecompilingmakemultithreading
Best Answer
(pacaur uses makepkg, see https://wiki.archlinux.org/index.php/Makepkg )
In
/etc/makepkg.conf
addMAKEFLAGS="-j$(expr $(nproc) \+ 1)"
to run #cores + 1 compiling jobs concurrently.When using bash you can also add
export MAKEFLAGS="-j$(expr $(nproc) \+ 1)"
to your~/.bashrc
to make this default for allmake
commands, not only those for AUR packages.