From 1d6fafa0fff844f3aea35ee0109e5103a14d86f2 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 3 Nov 2023 14:13:55 +0100 Subject: [PATCH] build(core): use the right number of jobs --- core/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index a2742ea37..6463a6ef8 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1,6 +1,12 @@ .PHONY: vendor -JOBS = 4 +# get the number of CPU cores in a "portable" manner +# (accounting for darwin and big.LITTLE archs) +JOBS = $(shell sysctl -n hw.perflevel0.physicalcpu 2>/dev/null ||\ + sysctl -n hw.physicalcpu 2>/dev/null ||\ + sysctl -n hw.ncpu 2>/dev/null ||\ + nproc 2>/dev/null ||\ + echo 4) MAKE = make -j $(JOBS) SCONS = scons -Q -j $(JOBS)