From 152f660f9b7285e7d7125be5dad923c046c4ef15 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 29 Mar 2019 18:36:17 +0100 Subject: [PATCH] TT#23584 Honor parallel build support We should honor the DEB_BUILD_OPTIONS parallel=N option and enable paralell builds for all make(1) invocations, not just the main one. Change-Id: I6aa0ae7e251aa5d9657a44581f4403ad6cfb073d --- debian/rules | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 2039dc700..e5fcafcfa 100755 --- a/debian/rules +++ b/debian/rules @@ -18,6 +18,13 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +# Enable parallel builds. +NUMJOBS = 1 +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -164,7 +171,7 @@ build-indep: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. - $(MAKE) -j`nproc` all + $(MAKE) all # make groups $(call PACKAGE_GRP_BUILD_template) $(call PACKAGE_EXTRA_BUILD_template)