Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Christian Heusel" <christian@heusel.eu>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
Date: Fri, 16 Aug 2024 23:18:15 +0900	[thread overview]
Message-ID: <20240816141844.1217356-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20240816141844.1217356-1-masahiroy@kernel.org>

objtree is defined and exported by the top-level Makefile. I prefer
not to override it.

There is no need to pass the absolute pass of objtree. PKGBUILD can
detect it by itself.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.package | 3 +--
 scripts/package/PKGBUILD | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 4a80584ec771..2c261a0d42b0 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -147,8 +147,7 @@ snap-pkg:
 PHONY += pacman-pkg
 pacman-pkg:
 	@ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
-	+objtree="$(realpath $(objtree))" \
-		BUILDDIR="$(realpath $(objtree))/pacman" \
+	BUILDDIR="$(realpath $(objtree))/pacman" \
 		CARCH="$(UTS_MACHINE)" \
 		KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
 		KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index e2d9c2601ca9..839cd5e634d2 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -40,7 +40,9 @@ _prologue() {
 	# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
 	# Bypass this override with a custom variable.
 	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
-	cd "${objtree}"
+
+	# Kbuild works in the output directory, where this PKGBUILD is located.
+	cd "$(dirname "${BASH_SOURCE[0]}")"
 }
 
 build() {
-- 
2.43.0


  reply	other threads:[~2024-08-16 14:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
2024-08-16 14:18 ` Masahiro Yamada [this message]
2024-08-16 19:01   ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree linux
2024-08-16 21:00   ` Nathan Chancellor
2024-08-17  9:53   ` Christian Heusel
2024-08-23 13:30   ` Masahiro Yamada
2024-08-16 18:59 ` [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function linux
2024-08-16 21:00 ` Nathan Chancellor
2024-08-17  9:51 ` Christian Heusel

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=20240816141844.1217356-2-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=christian@heusel.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    /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