From patchwork Wed Mar 15 17:35:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Germann X-Patchwork-Id: 13176414 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3A07C6FD1D for ; Wed, 15 Mar 2023 17:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232248AbjCORfj (ORCPT ); Wed, 15 Mar 2023 13:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbjCORfi (ORCPT ); Wed, 15 Mar 2023 13:35:38 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA151231E7; Wed, 15 Mar 2023 10:35:35 -0700 (PDT) From: Bastian Germann DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1678901733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nZku9m6kfdujj4yMSFGSvRZ2JtD5CDHhGlIEaw7ici4=; b=1RDu+4JQNGvY7f0c7ybbV0KMc8lGdoSAaheCLOkJM7mdBeSPgCOZmM3kWVaRhHJJnGveTa uBbm9iR95WzDy5rDE6526YKnP7WvtM5P17gGt2F/S9lx8x6HDVYHYIr1t5JJcBGvpa7J/8 OWJITatSTzY2V3mgTUvtxG0k0EPTCbrOCpy0GsC7SHnbrQVMVBt7xstX17JeOQ1/5MuY8h qO+gM3937xKuqpbyZPskUprrlCysnl1jzZGdHRGRYASU0bP7C7TmHHD5SNAP1PETqYCiH5 GPV27mTmIdHlhFH5SA+BCx6qPgDKmADfQjlpOjcEgii9g7lQlNlpRJo5KgJ+5w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1678901733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nZku9m6kfdujj4yMSFGSvRZ2JtD5CDHhGlIEaw7ici4=; b=/lkp2PeuVO+2FTtKJ0dQP24G6MDU+Vx5aof2hTWdnRNtUm/8mUx0X4X2EhHhryPZJlabTl ki8VOGnjLOCYiiBg== To: Masahiro Yamada Cc: Bastian Germann , Nathan Chancellor , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/1] kbuild: deb-pkg: Build parallely with current dpkg-buildpackage Date: Wed, 15 Mar 2023 18:35:24 +0100 Message-Id: <20230315173524.63179-2-bage@linutronix.de> In-Reply-To: <20230315173524.63179-1-bage@linutronix.de> References: <20230315173524.63179-1-bage@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org With dpkg-buildpackage v1.21.10 or later, the only way to build the deb-pkg generated package parallely is adding -j 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. 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 --- 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 < 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: