diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-09-15 10:21:24 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-09-15 10:21:24 +0000 |
commit | 1f87d10e85aab16cb28b36799ad37aa85f3e361f (patch) | |
tree | 7eae014a38c9914f9d45f1cecf614acaee6bd692 /include | |
parent | 9d164b87caa6b1949e42dc3180c102207b276888 (diff) |
build: add a config option for passing the top-level make jobserver to packages that have parallel build enabled, significantly improves parallelization and gets rid of CPU overcommit during intra-package parallel builds
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33414 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r-- | include/package.mk | 8 | ||||
-rw-r--r-- | include/toplevel.mk | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/package.mk b/include/package.mk index 64973b051..6b3617f77 100644 --- a/include/package.mk +++ b/include/package.mk @@ -15,11 +15,17 @@ PKG_MD5SUM ?= unknown PKG_BUILD_PARALLEL ?= PKG_INFO_DIR := $(STAGING_DIR)/pkginfo +ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),) + MAKE_J:=$(MAKE_JOBSERVER) +else + MAKE_J:=-j$(CONFIG_PKG_BUILD_JOBS) +endif + ifeq ($(strip $(PKG_BUILD_PARALLEL)),0) PKG_JOBS?=-j1 else PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\ - $(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS),-j1),-j1) + $(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1) endif include $(INCLUDE_DIR)/prereq.mk diff --git a/include/toplevel.mk b/include/toplevel.mk index d37ddb917..ba5af9c15 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -148,7 +148,7 @@ prereq:: prepare-tmpinfo .config echo "WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!"; \ fi \ ) - @+$(SUBMAKE) -r $@ + @+$(SUBMAKE) -r $@ MAKE_JOBSERVER="$(filter --jobserver% -j,$(MAKEFLAGS))" help: cat README |