From: Masahiro Yamada Date: Sat, 22 Jul 2023 04:47:50 +0000 (+0900) Subject: kbuild: rpm-pkg: do not hard-code $MAKE in spec file X-Git-Tag: v6.6.17~3988^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=192868258d2c9eb421228e4d65c4b09b838e7d93;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 92dbc88..e9217e9 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 # --------------------------------------------------------------------------- diff --git a/scripts/package/mkspec b/scripts/package/mkspec index a83b17b..9b2b438 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -38,6 +38,8 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ # $S: this line is enabled only when building source package # $M: this line is enabled only when CONFIG_MODULES is enabled sed -e '/^DEL/d' -e 's/^\t*//' <