Browse code

set cpus only if not set already

Brian Coca authored on 2017/01/20 13:09:55
Showing 2 changed files
... ...
@@ -48,10 +48,10 @@ endif
48 48
 
49 49
 ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
50 50
 DATE := $(shell date -j -r $(shell git log -n 1 --format="%at") +%Y%m%d%H%M)
51
-CPUS := $(shell sysctl hw.ncpu|awk '{print $$2}')
51
+CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
52 52
 else
53 53
 DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
54
-CPUS := $(shell nproc)
54
+CPUS ?= $(shell nproc)
55 55
 endif
56 56
 
57 57
 # DEB build parameters
... ...
@@ -1,11 +1,11 @@
1
-OS = $(shell uname -s)
1
+OS ?= $(shell uname -s)
2 2
 SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
3 3
 FORMATTER=../../hacking/module_formatter.py
4 4
 DUMPER=../../hacking/dump_playbook_attributes.py
5 5
 ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
6
-CPUS := $(shell sysctl hw.ncpu|awk '{print $$2}')
6
+CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
7 7
 else
8
-CPUS := $(shell nproc)
8
+CPUS ?= $(shell nproc)
9 9
 endif
10 10
 
11 11
 all: docs