History

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.

Masahiro Yamada committed 2 years ago

Commit 5b000f31 parent b6223c22 files · +4 −3Browse files

Unified · Split

2 files
  1. scripts/Makefile.package +1 −2
  2. scripts/package/PKGBUILD +3 −1
scripts/Makefile.package+1−2
@@ -147,8 +147,7 @@ snap-pkg: · 146 unmodified lines
147147 PHONY += pacman-pkg
148148 pacman-pkg:
149149 @ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
150− +objtree="$(realpath $(objtree))" \
151− BUILDDIR="$(realpath $(objtree))/pacman" \
150+ +BUILDDIR="$(realpath $(objtree))/pacman" \
152151 CARCH="$(UTS_MACHINE)" \
153152 KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
154153 KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
scripts/package/PKGBUILD+3−1
@@ -40,7 +40,9 @@ _prologue() { · 39 unmodified lines
4040 # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
4141 # Bypass this override with a custom variable.
4242 export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
43− cd "${objtree}"
43+
44+ # Kbuild works in the output directory, where this PKGBUILD is located.
45+ cd "$(dirname "${BASH_SOURCE[0]}")"
4446 }
4547
4648 build() {