diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-14 01:26:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-14 01:27:29 +0300 |
commit | 424e5be0467aad70bf249ca24b566f8a2d4e8c56 (patch) | |
tree | 85051227470b0cfa47c90073c092a64a79c3ba64 /GNUmakefile | |
parent | a2d4c26aa2e518313784b477b8b7c4ff819b521e (diff) |
Makefile support for using NPROCS as an env var
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/GNUmakefile b/GNUmakefile index 80366af2610..d37d810626f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -81,18 +81,20 @@ endif # ----------------------------------------------------------------------------- # Get the number of cores for threaded build -NPROCS:=1 -ifeq ($(OS), Linux) - NPROCS:=$(shell nproc) -endif -ifeq ($(OS), Darwin) - NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f3) -endif -ifeq ($(OS), FreeBSD) - NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 ) -endif -ifeq ($(OS), NetBSD) - NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 ) +ifndef NPROCS + NPROCS:=1 + ifeq ($(OS), Linux) + NPROCS:=$(shell nproc) + endif + ifeq ($(OS), Darwin) + NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f3) + endif + ifeq ($(OS), FreeBSD) + NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 ) + endif + ifeq ($(OS), NetBSD) + NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 ) + endif endif |