diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-12-30 11:09:15 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-02-12 11:11:37 -0500 |
commit | cb4e67fdee46116d6ec5ad37316cf7ff35ad1d7c (patch) | |
tree | f80546bcbeffb920f53d45ef3c9e350e69475159 | |
parent | 1571b695053c4ccad66c5151d78247a6590338d6 (diff) |
perf build: Add perf.o object building
Move the perf object building under build framework to be included in
the perf build object.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-wiiciip2w6ajvj03huqz50xw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/Build | 3 | ||||
-rw-r--r-- | tools/perf/Makefile.perf | 16 |
2 files changed, 8 insertions, 11 deletions
diff --git a/tools/perf/Build b/tools/perf/Build index 133ec649e5a2..976e03849f6d 100644 --- a/tools/perf/Build +++ b/tools/perf/Build | |||
@@ -25,12 +25,15 @@ perf-$(CONFIG_LIBELF) += builtin-probe.o | |||
25 | perf-y += bench/ | 25 | perf-y += bench/ |
26 | perf-y += tests/ | 26 | perf-y += tests/ |
27 | 27 | ||
28 | perf-y += perf.o | ||
29 | |||
28 | paths += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" | 30 | paths += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" |
29 | paths += -DPERF_INFO_PATH="BUILD_STR($(infodir_SQ))" | 31 | paths += -DPERF_INFO_PATH="BUILD_STR($(infodir_SQ))" |
30 | paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))" | 32 | paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))" |
31 | 33 | ||
32 | CFLAGS_builtin-help.o += $(paths) | 34 | CFLAGS_builtin-help.o += $(paths) |
33 | CFLAGS_builtin-timechart.o += $(paths) | 35 | CFLAGS_builtin-timechart.o += $(paths) |
36 | CFLAGS_perf.o += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" -include $(OUTPUT)PERF-VERSION-FILE | ||
34 | 37 | ||
35 | libperf-y += util/ | 38 | libperf-y += util/ |
36 | libperf-y += arch/ | 39 | libperf-y += arch/ |
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 713f4d17c553..0a669f990b68 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -376,16 +376,11 @@ PERF_IN := $(OUTPUT)perf-in.o | |||
376 | export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX | 376 | export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX |
377 | build := -f $(srctree)/tools/build/Makefile.build dir=. obj | 377 | build := -f $(srctree)/tools/build/Makefile.build dir=. obj |
378 | 378 | ||
379 | $(PERF_IN): $(OUTPUT)common-cmds.h FORCE | 379 | $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE |
380 | @$(MAKE) $(build)=perf | 380 | @$(MAKE) $(build)=perf |
381 | 381 | ||
382 | $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS | 382 | $(OUTPUT)perf: $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) |
383 | $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \ | 383 | $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) \ |
384 | '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ | ||
385 | $(CFLAGS) -c $(filter %.c,$^) -o $@ | ||
386 | |||
387 | $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(PERF_IN) | ||
388 | $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \ | ||
389 | $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ | 384 | $(BUILTIN_OBJS) $(PERF_IN) $(LIBS) -o $@ |
390 | 385 | ||
391 | $(GTK_IN): FORCE | 386 | $(GTK_IN): FORCE |
@@ -403,8 +398,7 @@ $(SCRIPTS) : % : %.sh | |||
403 | $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@' | 398 | $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@' |
404 | 399 | ||
405 | # These can record PERF_VERSION | 400 | # These can record PERF_VERSION |
406 | $(OUTPUT)perf.o perf.spec \ | 401 | perf.spec $(SCRIPTS) \ |
407 | $(SCRIPTS) \ | ||
408 | : $(OUTPUT)PERF-VERSION-FILE | 402 | : $(OUTPUT)PERF-VERSION-FILE |
409 | 403 | ||
410 | .SUFFIXES: | 404 | .SUFFIXES: |
@@ -659,7 +653,7 @@ config-clean: | |||
659 | @$(MAKE) -C config/feature-checks clean >/dev/null | 653 | @$(MAKE) -C config/feature-checks clean >/dev/null |
660 | 654 | ||
661 | clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean | 655 | clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean |
662 | $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) | 656 | $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) |
663 | @find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete | 657 | @find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete |
664 | @$(RM) .config-detected | 658 | @$(RM) .config-detected |
665 | $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 | 659 | $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 |