Commit 175209cc authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: pkg: use -f $(srctree)/Makefile to recurse to top Makefile

'$(MAKE) KBUILD_SRC=' changes the working directory back and forth
between objtree and srctree.

It is better to recurse to the top-level Makefile directly.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent ad15006c
...@@ -59,7 +59,7 @@ rpm-pkg: FORCE ...@@ -59,7 +59,7 @@ rpm-pkg: FORCE
# binrpm-pkg # binrpm-pkg
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
binrpm-pkg: FORCE binrpm-pkg: FORCE
$(MAKE) KBUILD_SRC= $(MAKE) -f $(srctree)/Makefile
$(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
$(UTS_MACHINE) -bb $(objtree)/binkernel.spec $(UTS_MACHINE) -bb $(objtree)/binkernel.spec
...@@ -102,7 +102,7 @@ clean-dirs += $(objtree)/snap/ ...@@ -102,7 +102,7 @@ clean-dirs += $(objtree)/snap/
# tarball targets # tarball targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
tar%pkg: FORCE tar%pkg: FORCE
$(MAKE) KBUILD_SRC= $(MAKE) -f $(srctree)/Makefile
$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
clean-dirs += $(objtree)/tar-install/ clean-dirs += $(objtree)/tar-install/
......
...@@ -86,12 +86,12 @@ cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" ...@@ -86,12 +86,12 @@ cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then
# Only some architectures with OF support have this target # Only some architectures with OF support have this target
if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then
$MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install $MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
fi fi
fi fi
if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_install
rm -f "$tmpdir/lib/modules/$version/build" rm -f "$tmpdir/lib/modules/$version/build"
rm -f "$tmpdir/lib/modules/$version/source" rm -f "$tmpdir/lib/modules/$version/source"
if [ "$ARCH" = "um" ] ; then if [ "$ARCH" = "um" ] ; then
...@@ -113,14 +113,14 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then ...@@ -113,14 +113,14 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
# resign stripped modules # resign stripped modules
MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)"
if [ -n "$MODULE_SIG_ALL" ]; then if [ -n "$MODULE_SIG_ALL" ]; then
INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_sign INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign
fi fi
fi fi
fi fi
if [ "$ARCH" != "um" ]; then if [ "$ARCH" != "um" ]; then
$MAKE headers_check KBUILD_SRC= $MAKE -f $srctree/Makefile headers_check
$MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"
fi fi
# Install the maintainer scripts # Install the maintainer scripts
......
...@@ -57,7 +57,7 @@ dirs=boot ...@@ -57,7 +57,7 @@ dirs=boot
# Try to install modules # Try to install modules
# #
if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then
make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install
dirs="$dirs lib" dirs="$dirs lib"
fi fi
......
...@@ -205,13 +205,15 @@ EOF ...@@ -205,13 +205,15 @@ EOF
cat <<EOF > debian/rules cat <<EOF > debian/rules
#!$(command -v $MAKE) -f #!$(command -v $MAKE) -f
srctree ?= .
build: build:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile
binary-arch: binary-arch:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg
clean: clean:
rm -rf debian/*tmp debian/files rm -rf debian/*tmp debian/files
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment