diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-02-13 22:05:14 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-02-19 19:42:46 -0500 |
commit | 175209cce23d6b0669ed5366add2517e26cd75cd (patch) | |
tree | 5eb1151733634b8cbceab40da1f46ec0309ed7bc /scripts | |
parent | ad15006cc78459d059af56729c4d9bed7c7fd860 (diff) |
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: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/package/Makefile | 4 | ||||
-rwxr-xr-x | scripts/package/builddeb | 10 | ||||
-rwxr-xr-x | scripts/package/buildtar | 2 | ||||
-rwxr-xr-x | scripts/package/mkdebian | 6 |
4 files changed, 12 insertions, 10 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 453fecee62f0..aa39c2b5e46a 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -59,7 +59,7 @@ rpm-pkg: FORCE | |||
59 | # binrpm-pkg | 59 | # binrpm-pkg |
60 | # --------------------------------------------------------------------------- | 60 | # --------------------------------------------------------------------------- |
61 | binrpm-pkg: FORCE | 61 | binrpm-pkg: FORCE |
62 | $(MAKE) KBUILD_SRC= | 62 | $(MAKE) -f $(srctree)/Makefile |
63 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec | 63 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec |
64 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ | 64 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
65 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec | 65 | $(UTS_MACHINE) -bb $(objtree)/binkernel.spec |
@@ -102,7 +102,7 @@ clean-dirs += $(objtree)/snap/ | |||
102 | # tarball targets | 102 | # tarball targets |
103 | # --------------------------------------------------------------------------- | 103 | # --------------------------------------------------------------------------- |
104 | tar%pkg: FORCE | 104 | tar%pkg: FORCE |
105 | $(MAKE) KBUILD_SRC= | 105 | $(MAKE) -f $(srctree)/Makefile |
106 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ | 106 | $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ |
107 | 107 | ||
108 | clean-dirs += $(objtree)/tar-install/ | 108 | clean-dirs += $(objtree)/tar-install/ |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index f43a274f4f1d..8ac25d10a6ad 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -86,12 +86,12 @@ cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" | |||
86 | if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then | 86 | if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then |
87 | # Only some architectures with OF support have this target | 87 | # Only some architectures with OF support have this target |
88 | if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then | 88 | if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then |
89 | $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install | 89 | $MAKE -f $srctree/Makefile INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install |
90 | fi | 90 | fi |
91 | fi | 91 | fi |
92 | 92 | ||
93 | if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | 93 | if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then |
94 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install | 94 | INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_install |
95 | rm -f "$tmpdir/lib/modules/$version/build" | 95 | rm -f "$tmpdir/lib/modules/$version/build" |
96 | rm -f "$tmpdir/lib/modules/$version/source" | 96 | rm -f "$tmpdir/lib/modules/$version/source" |
97 | if [ "$ARCH" = "um" ] ; then | 97 | if [ "$ARCH" = "um" ] ; then |
@@ -113,14 +113,14 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | |||
113 | # resign stripped modules | 113 | # resign stripped modules |
114 | MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" | 114 | MODULE_SIG_ALL="$(grep -s '^CONFIG_MODULE_SIG_ALL=y' $KCONFIG_CONFIG || true)" |
115 | if [ -n "$MODULE_SIG_ALL" ]; then | 115 | if [ -n "$MODULE_SIG_ALL" ]; then |
116 | INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_sign | 116 | INSTALL_MOD_PATH="$tmpdir" $MAKE -f $srctree/Makefile modules_sign |
117 | fi | 117 | fi |
118 | fi | 118 | fi |
119 | fi | 119 | fi |
120 | 120 | ||
121 | if [ "$ARCH" != "um" ]; then | 121 | if [ "$ARCH" != "um" ]; then |
122 | $MAKE headers_check KBUILD_SRC= | 122 | $MAKE -f $srctree/Makefile headers_check |
123 | $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" | 123 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" |
124 | fi | 124 | fi |
125 | 125 | ||
126 | # Install the maintainer scripts | 126 | # Install the maintainer scripts |
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index d624a07a4e77..cfd2a4a3fe42 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar | |||
@@ -57,7 +57,7 @@ dirs=boot | |||
57 | # Try to install modules | 57 | # Try to install modules |
58 | # | 58 | # |
59 | if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then | 59 | if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then |
60 | make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install | 60 | make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install |
61 | dirs="$dirs lib" | 61 | dirs="$dirs lib" |
62 | fi | 62 | fi |
63 | 63 | ||
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index edcad61fe3cd..f030961c5165 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian | |||
@@ -205,13 +205,15 @@ EOF | |||
205 | cat <<EOF > debian/rules | 205 | cat <<EOF > debian/rules |
206 | #!$(command -v $MAKE) -f | 206 | #!$(command -v $MAKE) -f |
207 | 207 | ||
208 | srctree ?= . | ||
209 | |||
208 | build: | 210 | build: |
209 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ | 211 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
210 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= | 212 | KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile |
211 | 213 | ||
212 | binary-arch: | 214 | binary-arch: |
213 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ | 215 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
214 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg | 216 | KBUILD_BUILD_VERSION=${revision} -f \$(srctree)/Makefile intdeb-pkg |
215 | 217 | ||
216 | clean: | 218 | clean: |
217 | rm -rf debian/*tmp debian/files | 219 | rm -rf debian/*tmp debian/files |