aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/Makefile
diff options
context:
space:
mode:
authorFrans Pop <elendil@planet.nl>2009-08-25 16:15:39 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-10-11 17:21:24 -0400
commitdb9038c89d129383a9db2afcb72b504fe54f6edf (patch)
tree52717e88f15718bd30077e18a75ac38e87d908fa /scripts/package/Makefile
parentf144c78e525542c94e0dcb171b41cc5ef7b341b3 (diff)
kbuild: fix the binrpm-pkg target to work with KBUILD_OUTPUT set
The binrpm-pkg target (binary RPM only) fails when called with KBUILD_OUTPUT set. This patch makes it work. For the rpm-pkg target (source + binary RPM), building with KBUILD_OUTPUT set is not possible and also not needed as the actual build is done in a temporary directory anyway, so check that KBUILD_OUTPUT is not set in that case to avoid later errors. Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/package/Makefile')
-rw-r--r--scripts/package/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index fa4a0a17b7e0..f67cc885c807 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -18,6 +18,9 @@
18# e) generate the rpm files, based on kernel.spec 18# e) generate the rpm files, based on kernel.spec
19# - Use /. to avoid tar packing just the symlink 19# - Use /. to avoid tar packing just the symlink
20 20
21# Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT,
22# but the binrpm-pkg target can; for some reason O= gets ignored.
23
21# Do we have rpmbuild, otherwise fall back to the older rpm 24# Do we have rpmbuild, otherwise fall back to the older rpm
22RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ 25RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
23 else echo rpm; fi) 26 else echo rpm; fi)
@@ -33,6 +36,12 @@ $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
33 $(CONFIG_SHELL) $(MKSPEC) > $@ 36 $(CONFIG_SHELL) $(MKSPEC) > $@
34 37
35rpm-pkg rpm: $(objtree)/kernel.spec FORCE 38rpm-pkg rpm: $(objtree)/kernel.spec FORCE
39 @if test -n "$(KBUILD_OUTPUT)"; then \
40 echo "Building source + binary RPM is not possible outside the"; \
41 echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
42 echo "binrpm-pkg target instead."; \
43 false; \
44 fi
36 $(MAKE) clean 45 $(MAKE) clean
37 $(PREV) ln -sf $(srctree) $(KERNELPATH) 46 $(PREV) ln -sf $(srctree) $(KERNELPATH)
38 $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion 47 $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion
@@ -61,7 +70,7 @@ binrpm-pkg: $(objtree)/binkernel.spec FORCE
61 set -e; \ 70 set -e; \
62 mv -f $(objtree)/.tmp_version $(objtree)/.version 71 mv -f $(objtree)/.tmp_version $(objtree)/.version
63 72
64 $(RPM) $(RPMOPTS) --define "_builddir $(srctree)" --target \ 73 $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \
65 $(UTS_MACHINE) -bb $< 74 $(UTS_MACHINE) -bb $<
66 75
67clean-files += $(objtree)/binkernel.spec 76clean-files += $(objtree)/binkernel.spec