[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230315173524.63179-2-bage@linutronix.de>
Date: Wed, 15 Mar 2023 18:35:24 +0100
From: Bastian Germann <bage@...utronix.de>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Bastian Germann <bage@...utronix.de>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3 1/1] kbuild: deb-pkg: Build parallely with current dpkg-buildpackage
With dpkg-buildpackage v1.21.10 or later, the only way to build the
deb-pkg generated package parallely is adding -j<N> to the MAKEFLAGS
environment variable or using the --jobs-force option, see dpkg commit
1d0ea9b2ba3f ("dpkg-buildpackage: Change -j, --jobs semantics to
non-force mode"). The package ignores the usual parallel build option
that is described in Debian Policy.
Derive make's -j parameter from the DEB_BUILD_OPTIONS environment variable
that ends up being set by dpkg-buildpackage -j<N>. The snippet is copied
from Debian Policy.
Link: https://www.debian.org/doc/debian-policy/ch-source.html#debian-rules-and-deb-build-options
Signed-off-by: Bastian Germann <bage@...utronix.de>
---
scripts/package/mkdebian | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index f74380036bb5..ed5c2b65798b 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -238,6 +238,11 @@ fi
cat <<EOF > debian/rules
#!$(command -v $MAKE) -f
+ifneq (,\$(filter parallel=%,\$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = \$(patsubst parallel=%,%,\$(filter parallel=%,\$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j\$(NUMJOBS)
+endif
+
srctree ?= .
build-indep:
--
2.39.2
Powered by blists - more mailing lists