diff --git a/Makefile b/Makefile index 1c92147cb..ebf225d62 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ prefix ?= $(DESTDIR)/usr endif ifndef NOPARALLEL -export MAKEFLAGS+=" -j$(( $(nproc) + 1)) " +export MAKEFLAGS+=" -j$$(( $$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 8) + 1)) " endif debug install-debug uninstall-debug test-debug: build ?= debug diff --git a/deps.mk b/deps.mk index fe68ccddc..334818d4a 100644 --- a/deps.mk +++ b/deps.mk @@ -4,7 +4,7 @@ rime_root = $(CURDIR) src_dir = $(rime_root)/deps ifndef NOPARALLEL -export MAKEFLAGS+=" -j$(( $(nproc) + 1)) " +export MAKEFLAGS+=" -j$$(( $$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || echo 8) + 1)) " endif build ?= build