diff options
author | Tom Jones <thj@freebsd.org> | 2024-02-07 13:17:17 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2024-03-26 15:09:39 +0000 |
commit | 26eec75f2b30f4c03b4ca671165cd0d4823f0175 (patch) | |
tree | 97f2260489d8d76a89f61c7de64e4e0eb4f76dd0 /build/external | |
parent | b10561bbecb2870360a731b4696bff920150720d (diff) |
build: Detect number of CPUs for build processes on FreeBSD
Type: improvement
Change-Id: Ia3a00266f47f0c3e567efa143ef08bf4e8cffe35
Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'build/external')
-rw-r--r-- | build/external/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/build/external/Makefile b/build/external/Makefile index c5e6f634dd7..046dd7484ae 100644 --- a/build/external/Makefile +++ b/build/external/Makefile @@ -21,8 +21,12 @@ INSTALL_DIR ?= $(CURDIR)/_install PKG_VERSION ?= $(shell git describe --abbrev=0 --match 'v[0-9]*' | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2) PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l) SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct .) +ifeq ($shell(uname), FreeBSD) +JOBS := $(shell nproc) +else JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\ $(shell grep -c ^processor /proc/cpuinfo), 2) +endif # FreeBSD B := $(BUILD_DIR) I := $(INSTALL_DIR) |