summaryrefslogtreecommitdiffstats
path: root/scripts/package
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2015-09-02 11:57:08 +0200
committerMichal Marek <mmarek@suse.com>2015-09-04 11:24:50 +0200
commit26803821463c4e76322559b3dfb0c6b0fcc8aee8 (patch)
tree09baa1e3ec6d0d622f7672a884d34662d39b4d1b /scripts/package
parentscripts: add stackdelta script (diff)
downloadlinux-26803821463c4e76322559b3dfb0c6b0fcc8aee8.tar.xz
linux-26803821463c4e76322559b3dfb0c6b0fcc8aee8.zip
package/Makefile: move source tar creation to a function
Split source tarball creation from rpm-pkg target so it can be used from deb-pkg target as well. As added bonus, we can now pretty print TAR the name of tarball created in quiet mode This patch prepares the groundwork for deb-pkg source package adding bit. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/package')
-rw-r--r--scripts/package/Makefile29
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 8b11d5adec7f..297e75684738 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -24,27 +24,30 @@
# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
# Include only those top-level files that are needed by make, plus the GPL copy
-TAR_CONTENT := $(KBUILD_ALLDIRS) kernel.spec .config .scmversion Makefile \
+TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \
Kbuild Kconfig COPYING $(wildcard localversion*)
-TAR_CONTENT := $(addprefix $(KERNELPATH)/,$(TAR_CONTENT))
MKSPEC := $(srctree)/scripts/package/mkspec
+quiet_cmd_src_tar = TAR $(2).tar.gz
+ cmd_src_tar = \
+if test "$(objtree)" != "$(srctree)"; then \
+ echo "Building source tarball is not possible outside the"; \
+ echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
+ echo "binrpm-pkg or bindeb-pkg target instead."; \
+ false; \
+fi ; \
+$(srctree)/scripts/setlocalversion --save-scmversion; \
+ln -sf $(srctree) $(2); \
+tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
+ $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \
+rm -f $(2) $(objtree)/.scmversion
+
# rpm-pkg
# ---------------------------------------------------------------------------
rpm-pkg rpm: FORCE
- @if test "$(objtree)" != "$(srctree)"; then \
- echo "Building source + binary RPM is not possible outside the"; \
- echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
- echo "binrpm-pkg target instead."; \
- false; \
- fi
$(MAKE) clean
- ln -sf $(srctree) $(KERNELPATH)
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
- $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
- tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT)
- rm $(KERNELPATH)
- rm -f $(objtree)/.scmversion
+ $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
mv -f $(objtree)/.tmp_version $(objtree)/.version
rpmbuild --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz