]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kbuild: pacman-pkg: do not override objtree
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 16 Aug 2024 14:18:15 +0000 (23:18 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 1 Sep 2024 11:34:49 +0000 (20:34 +0900)
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 <masahiroy@kernel.org>
Acked-by:  Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Christian Heusel <christian@heusel.eu>
scripts/Makefile.package
scripts/package/PKGBUILD

index 4a80584ec771216c4ea737b289ec653defb8f1f0..11d53f240a2bc7f13b9fef5c1aeb5be3409be60d 100644 (file)
@@ -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)" \
index e2d9c2601ca98b688a043654da3a219cbc737cec..839cd5e634d20b311a63a5cb80a88d627fa0bc00 100644 (file)
@@ -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() {