summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.package
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-07-22 13:47:50 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-07-25 00:59:32 +0900
commit192868258d2c9eb421228e4d65c4b09b838e7d93 (patch)
tree311a50bb8eb31afb5dfc7934030ddc6bb6582260 /scripts/Makefile.package
parent61eca933d0a63f0889df604df6bb38938f3c7cad (diff)
downloadlinux-stable-192868258d2c9eb421228e4d65c4b09b838e7d93.tar.gz
linux-stable-192868258d2c9eb421228e4d65c4b09b838e7d93.tar.bz2
linux-stable-192868258d2c9eb421228e4d65c4b09b838e7d93.zip
kbuild: rpm-pkg: do not hard-code $MAKE in spec file
Currently, $MAKE will expand to the GNU Make program that created the source RPM. This is problematic if you carry it to a different build host to run 'rpmbuild' there. Consider this command: $ /path/to/my/custom/make srcrpm-pkg The spec file in the SRPM will record '/path/to/my/custom/make', which exists only on that build environment. To create a portable SRPM, the spec file should avoid hard-coding $MAKE. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.package')
-rw-r--r--scripts/Makefile.package5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 92dbc889bd7c..e9217e997c68 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -72,7 +72,7 @@ PHONY += rpm-pkg
rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec)
rpm-pkg: srcrpm-pkg
+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \
- --define='_smp_mflags %{nil}'
+ --define='_smp_mflags %{nil}' --define='make $(MAKE)'
# srcrpm-pkg
# ---------------------------------------------------------------------------
@@ -89,7 +89,8 @@ binrpm-pkg:
$(MAKE) -f $(srctree)/Makefile
$(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
- $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec
+ $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec \
+ --define='make $(MAKE)'
# deb-pkg srcdeb-pkg bindeb-pkg
# ---------------------------------------------------------------------------