From df1b36c3873b841589f9f6cb2af1b779b49deb04 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sat, 18 Oct 2014 17:29:48 +0000 Subject: 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 --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v0.12