Commit 3e2751d9 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
Acked-by: default avatarWang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-kb0qs29zbz7hxn32mc5zbsoz@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a9edec3c
...@@ -68,6 +68,20 @@ all tags TAGS: ...@@ -68,6 +68,20 @@ all tags TAGS:
$(print_msg) $(print_msg)
$(make) $(make)
ifdef MAKECMDGOALS
has_clean := 0
ifneq ($(filter clean,$(MAKECMDGOALS)),)
has_clean := 1
endif # clean
ifeq ($(has_clean),1)
rest := $(filter-out clean,$(MAKECMDGOALS))
ifneq ($(rest),)
$(rest): clean
endif # rest
endif # has_clean
endif # MAKECMDGOALS
# #
# The clean target is not really parallel, don't print the jobs info: # The clean target is not really parallel, don't print the jobs info:
# #
......
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