Commit 4b63f603 authored by Riku Voipio's avatar Riku Voipio Committed by Michal Marek

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: default avatarRiku Voipio <riku.voipio@linaro.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
parent 0f684317
...@@ -118,12 +118,12 @@ quiet_cmd_perf_tar = TAR ...@@ -118,12 +118,12 @@ quiet_cmd_perf_tar = TAR
cmd_perf_tar = \ cmd_perf_tar = \
git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \
HEAD^{tree} $$(cd $(srctree); \ HEAD^{tree} $$(cd $(srctree); \
echo $$(cat $(srctree)/tools/perf/MANIFEST)) \ echo $$(cat tools/perf/MANIFEST)) \
-o $(perf-tar).tar; \ -o $(perf-tar).tar; \
mkdir -p $(perf-tar); \ mkdir -p $(perf-tar); \
git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \
(cd $(srctree)/tools/perf; \ (cd $(srctree)/tools/perf; \
util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null); \ util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \
tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
rm -r $(perf-tar); \ rm -r $(perf-tar); \
$(if $(findstring tar-src,$@),, \ $(if $(findstring tar-src,$@),, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment