summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-10-18 17:29:48 (GMT)
committerTimothy Gu <timothygu99@gmail.com>2014-10-18 17:31:12 (GMT)
commitdf1b36c3873b841589f9f6cb2af1b779b49deb04 (patch)
treedc9c9a972eb6af06266ef92e1e2f0c43b3f4ae9c
parent2eb269842747ec6d27b356fef10a9639443f7229 (diff)
downloadmxe-df1b36c3873b841589f9f6cb2af1b779b49deb04.zip
mxe-df1b36c3873b841589f9f6cb2af1b779b49deb04.tar.gz
mxe-df1b36c3873b841589f9f6cb2af1b779b49deb04.tar.bz2
Show autodetected cores when no $(JOBS) is specified
If there is a more readable way of doing this, please point out. Signed-off-by: Timothy Gu <timothygu99@gmail.com>
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fa66103..439459e 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,12 @@ PKG_CDN := d1yihgixbnrglp.cloudfront.net
PWD := $(shell pwd)
SHELL := bash
NPROCS := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
-JOBS := $(shell printf "$(DEFAULT_MAX_JOBS)\n$(NPROCS)" | sort -n | head -1)
+JOBS_AUTO := $(shell printf "$(DEFAULT_MAX_JOBS)\n$(NPROCS)" | sort -n | head -1)
+JOBS := $(strip $(if $(findstring undefined,$(origin JOBS)),\
+ $(info [using autodetected $(JOBS_AUTO) job(s)]) \
+ $(JOBS_AUTO)\
+ ,\
+ $(JOBS)))
DATE := $(shell gdate --help >/dev/null 2>&1 && echo g)date
INSTALL := $(shell ginstall --help >/dev/null 2>&1 && echo g)install