From patchwork Wed Mar 15 16:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bastian Germann X-Patchwork-Id: 13176319 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 EA512C7618B for ; Wed, 15 Mar 2023 16:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbjCOQaA (ORCPT ); Wed, 15 Mar 2023 12:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjCOQ35 (ORCPT ); Wed, 15 Mar 2023 12:29:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6F4438B52; Wed, 15 Mar 2023 09:29:53 -0700 (PDT) From: Bastian Germann DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1678897791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z/XBXXM6poOLUz6DLq//1r04pc3BCCslWpFv9PZ8fEc=; b=GscP2+3jHOr3BREJist/ojOJw87k8P26mjNBXmnNaVV/gHIOSrxS1Sgz3e+XWIzB9XCjRa VdoRpW56dkG0i3ylLaU4zBhpej3BoMxWL6l5To5hXMWApve9UJXjYtOciVjyIP6fn1gah0 sEHBEu9Cr2Db38kd5GM25nNHfvlGJ2etLjUgB6OVqQgL+5f3Pb7gGjTUaeFY5Wm2WWMbOZ Xd0AfYhmGACyYK/62L+pe4UMi/3QIWGehFUs9XrcOxDHZ4Eif+6vC8dn3AccYpkQoCeh0M MZbo6ugx8OAaxgFT6uuAjmw5R751Hr6vy6yBxHPymlBlxwv+mnJ2FpEkOmED0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1678897791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z/XBXXM6poOLUz6DLq//1r04pc3BCCslWpFv9PZ8fEc=; b=Fnu7swAXfJvnaMocIo95rNtJX2JHcuJxlsAAl71yCa7MbEqFA7JenT+F8/Hkf7Iw7D2wJS ZzLqEtAePRLYu4AA== To: Masahiro Yamada Cc: Bastian Germann , Nathan Chancellor , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/1] kbuild: deb-pkg: Build parallely with current dpkg-buildpackage Date: Wed, 15 Mar 2023 17:29:43 +0100 Message-Id: <20230315162944.39542-2-bage@linutronix.de> In-Reply-To: <20230315162944.39542-1-bage@linutronix.de> References: <20230315162944.39542-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. 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 dpkg-buildpackage -j. Link: https://www.debian.org/doc/debian-policy/ch-source.html Signed-off-by: Bastian Germann --- scripts/package/mkdebian | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index f74380036bb5..0217790e7a26 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -238,11 +238,15 @@ fi cat < debian/rules #!$(command -v $MAKE) -f +ifneq (,\$(filter parallel=%,\$(DEB_BUILD_OPTIONS))) + JOBS = -j\$(subst parallel=,,\$(filter parallel=%,\$(DEB_BUILD_OPTIONS))) +endif + srctree ?= . build-indep: build-arch: - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \ + \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \$(JOBS) \ \$(shell \$(srctree)/scripts/package/deb-build-option) \ olddefconfig all @@ -250,10 +254,10 @@ build: build-arch binary-indep: binary-arch: build-arch - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} intdeb-pkg + \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \$(JOBS) intdeb-pkg clean: rm -rf debian/files debian/linux-* - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} clean + \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \$(JOBS) clean binary: binary-arch EOF