diff options
| author | Jiri Olsa <jolsa@redhat.com> | 2016-02-04 06:30:36 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-04 13:53:16 -0500 |
| commit | 3e2751d9169563486c2bfe7382726f1315cb156b (patch) | |
| tree | 8554164c23d57ecd5590b79ecfd7797730e7f1f9 | |
| parent | a9edec3ce211d776736b35b14b9bd2c0b5ed860b (diff) | |
perf tools: Fix parallel build including 'clean' target
Do not parallelize 'clean' with other targets, figure out if it is
present and do it first, then the other targets.
Noticed with:
tools/perf> make -j24 clean all
LD arch/libperf-in.o
LD plugin_xen-in.o
arch//libperf-in.o: file not recognized: File truncated
make[3]: *** [arch/libperf-in.o] Error 1
make[2]: *** [arch] Error 2
make[2]: *** Waiting for unfinished jobs....
AR libapi.a
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-kb0qs29zbz7hxn32mc5zbsoz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 4b68f465195c..67837c6cdbd8 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -68,6 +68,20 @@ all tags TAGS: | |||
| 68 | $(print_msg) | 68 | $(print_msg) |
| 69 | $(make) | 69 | $(make) |
| 70 | 70 | ||
| 71 | ifdef MAKECMDGOALS | ||
| 72 | has_clean := 0 | ||
| 73 | ifneq ($(filter clean,$(MAKECMDGOALS)),) | ||
| 74 | has_clean := 1 | ||
| 75 | endif # clean | ||
| 76 | |||
| 77 | ifeq ($(has_clean),1) | ||
| 78 | rest := $(filter-out clean,$(MAKECMDGOALS)) | ||
| 79 | ifneq ($(rest),) | ||
| 80 | $(rest): clean | ||
| 81 | endif # rest | ||
| 82 | endif # has_clean | ||
| 83 | endif # MAKECMDGOALS | ||
| 84 | |||
| 71 | # | 85 | # |
| 72 | # The clean target is not really parallel, don't print the jobs info: | 86 | # The clean target is not really parallel, don't print the jobs info: |
| 73 | # | 87 | # |
