Skip to content

Commit

Permalink
kbuild: pacman-pkg: do not override objtree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
masahir0y committed Sep 1, 2024
1 parent b6223c2 commit 5b000f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions scripts/Makefile.package
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand Down
4 changes: 3 additions & 1 deletion scripts/package/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 5b000f3

Please sign in to comment.