public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastian Germann <bage@linutronix.de>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Bastian Germann <bage@linutronix.de>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] kbuild: deb-pkg: Allow parallel build
Date: Mon, 13 Mar 2023 18:10:36 +0100	[thread overview]
Message-ID: <20230313171036.268407-2-bage@linutronix.de> (raw)
In-Reply-To: <20230313171036.268407-1-bage@linutronix.de>

Currently, the only way to build the deb-pkg generated package parallely
is adding -jN to the MAKEFLAGS environment variable. The package ignores
the usual parallel build option that is described in Debian Policy §4.9.1.

Derive make's -j parameter from the DEB_BUILD_OPTIONS environment variable
that ends up being set by Debian's build tools.

Link: https://www.debian.org/doc/debian-policy/ch-source.html
Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 scripts/package/deb-build-option | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/package/deb-build-option b/scripts/package/deb-build-option
index b079b0d121d4..dd170e2b3018 100755
--- a/scripts/package/deb-build-option
+++ b/scripts/package/deb-build-option
@@ -7,6 +7,12 @@ if [ -z "${CROSS_COMPILE}${cross_compiling}" -a "${DEB_HOST_ARCH}" != "${DEB_BUI
 	echo CROSS_COMPILE=${DEB_HOST_GNU_TYPE}-
 fi
 
+for build_opt in $DEB_BUILD_OPTIONS; do
+	if [ "${build_opt#parallel=}" != "$build_opt" ]; then
+		echo -j${build_opt#parallel=}
+	fi
+done
+
 version=$(dpkg-parsechangelog -S Version)
 version_upstream="${version%-*}"
 debian_revision="${version#${version_upstream}}"
-- 
2.39.2


  reply	other threads:[~2023-03-13 17:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 17:10 [PATCH 0/1] kbuild: deb-pkg: Allow parallel build Bastian Germann
2023-03-13 17:10 ` Bastian Germann [this message]
2023-03-13 17:59   ` [PATCH 1/1] " Masahiro Yamada
2023-03-13 18:56     ` Bastian Germann
2023-03-15 14:18       ` Masahiro Yamada
2023-03-15 15:51         ` Bastian Germann
2023-03-15 16:36           ` Masahiro Yamada
2023-03-15 15:56         ` Sedat Dilek
2023-03-15 16:39           ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230313171036.268407-2-bage@linutronix.de \
    --to=bage@linutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox