From cc789d18b123fc1f6518edab4097cd01e3453360 Mon Sep 17 00:00:00 2001 From: nosamad Date: Sun, 7 Jun 2020 16:33:30 +0200 Subject: [PATCH] Squashed 'build/dobuild/' changes from f2f5f7f..0614105 0614105 fixes default extdir 6c336fe fix usage of default job slots vs nproc git-subtree-dir: build/dobuild git-subtree-split: 0614105caa1bf9a6f44ebce333436ccebc7f5a9c --- defaults.mk | 3 ++- docker.mk | 2 +- generic.mk | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults.mk b/defaults.mk index 37447c7..6c01ce7 100644 --- a/defaults.mk +++ b/defaults.mk @@ -552,7 +552,7 @@ HOST_CONTAINER = $(call memorize,HOST_CONTAINER,$(DOBUILD_HOSTCONTAINER)) SOURCE_DATE_EPOCH ?= $(call memorize,SOURCE_DATE_EPOCH,$(shell $(DOBUILDDIR)/bin/get_source_date_epoch $(TOPDIR))) BUILDTIME = $(call memorize,BUILDTIME,$(shell date -u -d '@$(SOURCE_DATE_EPOCH)' --rfc-3339 ns 2>/dev/null)) -JOBSLOTS_DEFAULT = $(if $(findstring --jobserver-,$(make_cmdline)),2,$(shell nproc 2>/dev/null || echo '2')) +JOBSLOTS_DEFAULT = $(if $(findstring --jobserver-,$(make_cmdline)),2,$(nproc)) JOBSLOTS = $(call memorize,JOBSLOTS,$(or $(DOBUILD_JOBSLOTS),$(JOBSLOTS_DEFAULT))) SKIP_MD5SUM = $(call memorize,SKIP_MD5SUM,$(DOBUILD_SKIPMD5SUM)) @@ -590,6 +590,7 @@ $(VERBOSE)SILENT := @ make_pid = $(call memorize,make_pid,$(shell echo "$$PPID")) make_cmdline = $(call memorize,make_cmdline,$(shell set -- $$(ps T 2>/dev/null | sed -n -e 's!^\s*$(make_pid)\s\+.*\($(call escape,$(MAKE),!)\s\+.*\)!\1!p') && echo "$$@")) +nproc = $(call memorize,nproc,$(shell nproc || echo '1')) machine = $(call memorize,machine,$(shell uname -m 2>/dev/null)) make_version = $(MAKE_VERSION) diff --git a/docker.mk b/docker.mk index 5512492..6ae1b89 100644 --- a/docker.mk +++ b/docker.mk @@ -344,7 +344,7 @@ ifeq ($(docker_portable_workspace),) container_destdir = $(abspath $(DESTDIR)) endif -container_cpus = $(call min,$(INTERNPARALLEL) $(JOBSLOTS_DEFAULT)) +container_cpus = $(call min,$(INTERNPARALLEL) $(nproc)) container_cpuperiod = 100000 container_quota = $(call bc,($(container_cpus)*$(container_cpuperiod))) container_nproc = $(INTERNPARALLEL) diff --git a/generic.mk b/generic.mk index cc7b912..d1d7aa8 100644 --- a/generic.mk +++ b/generic.mk @@ -105,7 +105,7 @@ generic_default_prerequisites = \ # retrieves the target generic default extension directory # $(call generic_default_extdir,target-name) -generic_default_extdir = $(addprefix $(PROJECTDIR)/dobuild-extensions/,$(cache.$1.adapter)) +generic_default_extdir = $(addprefix $(addsuffix /,$(EXTDIR)),$(cache.$1.adapter)) # creates a generic run rule command # $(call generic_run_cmd,target-name,command[,args],alternative-command[,output-command])