diff options
author | Michal Marek <mmarek@suse.cz> | 2013-04-13 15:21:15 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2013-04-18 08:56:54 -0400 |
commit | 6501320311664e11ad5489fedb17ea1f817c2617 (patch) | |
tree | 0fcf7e4d22ca584a737b876241b69c517cc8b22c /scripts/package | |
parent | 403d3cc47307c78597d75e420f091cf4a2e7a56a (diff) |
rpm-pkg: Always regenerate the specfile
The *pkg targets are always run, so it makes no sense to cache the
generated specfile. This also fixes build errors when the specfile
becomes out of date, without the Makefile noticing it:
$ make rpm
works
$ echo yadadada >localversion-test
$ make rpm
fails, because kernel.spec assumes the old kernel release string
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/package')
-rw-r--r-- | scripts/package/Makefile | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index ab203c29991a..08e4e2fdf8c0 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -35,10 +35,7 @@ MKSPEC := $(srctree)/scripts/package/mkspec | |||
35 | 35 | ||
36 | # rpm-pkg | 36 | # rpm-pkg |
37 | # --------------------------------------------------------------------------- | 37 | # --------------------------------------------------------------------------- |
38 | $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile | 38 | rpm-pkg rpm: FORCE |
39 | $(CONFIG_SHELL) $(MKSPEC) > $@ | ||
40 | |||
41 | rpm-pkg rpm: $(objtree)/kernel.spec FORCE | ||
42 | @if test "$(objtree)" != "$(srctree)"; then \ | 39 | @if test "$(objtree)" != "$(srctree)"; then \ |
43 | echo "Building source + binary RPM is not possible outside the"; \ | 40 | echo "Building source + binary RPM is not possible outside the"; \ |
44 | echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ | 41 | echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \ |
@@ -47,6 +44,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE | |||
47 | fi | 44 | fi |
48 | $(MAKE) clean | 45 | $(MAKE) clean |
49 | ln -sf $(srctree) $(KERNELPATH) | 46 | ln -sf $(srctree) $(KERNELPATH) |
47 | $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec | ||
50 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion | 48 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion |
51 | tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT) | 49 | tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(TAR_CONTENT) |
52 | rm $(KERNELPATH) | 50 | rm $(KERNELPATH) |
@@ -56,17 +54,13 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE | |||
56 | set -e; \ | 54 | set -e; \ |
57 | mv -f $(objtree)/.tmp_version $(objtree)/.version | 55 | mv -f $(objtree)/.tmp_version $(objtree)/.version |
58 | $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz | 56 | $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz |
59 | rm $(KERNELPATH).tar.gz | 57 | rm $(KERNELPATH).tar.gz kernel.spec |
60 | |||
61 | clean-files := $(objtree)/kernel.spec | ||
62 | 58 | ||
63 | # binrpm-pkg | 59 | # binrpm-pkg |
64 | # --------------------------------------------------------------------------- | 60 | # --------------------------------------------------------------------------- |
65 | $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile | 61 | binrpm-pkg: FORCE |
66 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@ | ||
67 | |||
68 | binrpm-pkg: $(objtree)/binkernel.spec FORCE | ||
69 | $(MAKE) KBUILD_SRC= | 62 | $(MAKE) KBUILD_SRC= |
63 | $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec | ||
70 | set -e; \ | 64 | set -e; \ |
71 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version | 65 | $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version |
72 | set -e; \ | 66 | set -e; \ |
@@ -74,8 +68,7 @@ binrpm-pkg: $(objtree)/binkernel.spec FORCE | |||
74 | 68 | ||
75 | $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ | 69 | $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
76 | $(UTS_MACHINE) -bb $< | 70 | $(UTS_MACHINE) -bb $< |
77 | 71 | rm binkernel.spec | |
78 | clean-files += $(objtree)/binkernel.spec | ||
79 | 72 | ||
80 | # Deb target | 73 | # Deb target |
81 | # --------------------------------------------------------------------------- | 74 | # --------------------------------------------------------------------------- |