From: Masahiro Yamada Date: Fri, 16 Aug 2024 14:18:15 +0000 (+0900) Subject: kbuild: pacman-pkg: do not override objtree X-Git-Tag: v6.12-rc1~61^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b000f3cbb38c23992ee95fcd3e983ca66164eff;p=thirdparty%2Flinux.git kbuild: pacman-pkg: do not override objtree objtree is defined and exported by the top-level Makefile. I prefer not to override it. There is no need to pass the absolute path of objtree. PKGBUILD can detect it by itself. Signed-off-by: Masahiro Yamada Acked-by:  Thomas Weißschuh Reviewed-by: Nathan Chancellor Reviewed-by: Christian Heusel --- diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 4a80584ec7712..11d53f240a2bc 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 e2d9c2601ca98..839cd5e634d20 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() {