aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/Makefile
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2015-09-01 10:14:21 -0400
committerMichal Marek <mmarek@suse.com>2015-11-24 11:49:42 -0500
commit4b63f603135022ca048524cd16f1c6a76a3f169d (patch)
tree8e79baf75861d24e9cb08843484052340d97e724 /scripts/package/Makefile
parent0f684317a7e0e7b6075ebfa5311b0c106eb1b802 (diff)
package Makefile: fix perf-tar targets when outdir is set
building with $srctree != $objtree, perf-tar-* targets fail to read the MANIFEST file and add the PERF-VERSION-FILE needed by out-of-tree builds. The build errors and an incorrect tar is created: $ make O=build-x86 perf-targz-src-pkg TAR cat: ../tools/perf/MANIFEST: No such file or directory tar: perf-4.1.0-rc8/PERF-VERSION-FILE: Cannot stat: No such file or dir.. tar: Exiting with failure status due to previous errors Kbuild sets objtree to "." and srctree to ".." The command to output MANIFEST becomes: $(cd ..; echo $(cat ../tools/perf/MANIFEST)) Without MANIFEST, the entire kernel source tree is added to the perf source tarball. The *correct* fix is to keep the cd and remove srctree from cat command line since MANIFEST has wildcards that fail to expand working directory isn't srctree. Second, PERF-VERSION-FILE gets not added, because in-tree build path is hardcoded to Makefile: util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null) The PERF-VERSION-GEN needs to be run from tools/perf directory, and the output directory needs to be changed from relative to to absolute. This can be achieved using the $(CURDIR) variable. Also remove the error redirect to /dev/null which hid the error. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/package/Makefile')
-rw-r--r--scripts/package/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 1aca224e8597..c2c7389bfbab 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -118,12 +118,12 @@ quiet_cmd_perf_tar = TAR
118 cmd_perf_tar = \ 118 cmd_perf_tar = \
119git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ 119git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \
120 HEAD^{tree} $$(cd $(srctree); \ 120 HEAD^{tree} $$(cd $(srctree); \
121 echo $$(cat $(srctree)/tools/perf/MANIFEST)) \ 121 echo $$(cat tools/perf/MANIFEST)) \
122 -o $(perf-tar).tar; \ 122 -o $(perf-tar).tar; \
123mkdir -p $(perf-tar); \ 123mkdir -p $(perf-tar); \
124git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ 124git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \
125(cd $(srctree)/tools/perf; \ 125(cd $(srctree)/tools/perf; \
126util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null); \ 126util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \
127tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ 127tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
128rm -r $(perf-tar); \ 128rm -r $(perf-tar); \
129$(if $(findstring tar-src,$@),, \ 129$(if $(findstring tar-src,$@),, \