aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile.perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/Makefile.perf')
-rw-r--r--tools/perf/Makefile.perf42
1 files changed, 33 insertions, 9 deletions
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 7257e7e9e38a..50d875d970c4 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -7,6 +7,8 @@ include config/utilities.mak
7 7
8# Define V to have a more verbose compile. 8# Define V to have a more verbose compile.
9# 9#
10# Define VF to have a more verbose feature check output.
11#
10# Define O to save output files in a separate directory. 12# Define O to save output files in a separate directory.
11# 13#
12# Define ARCH as name of target architecture if you want cross-builds. 14# Define ARCH as name of target architecture if you want cross-builds.
@@ -55,6 +57,9 @@ include config/utilities.mak
55# Define NO_LIBAUDIT if you do not want libaudit support 57# Define NO_LIBAUDIT if you do not want libaudit support
56# 58#
57# Define NO_LIBBIONIC if you do not want bionic support 59# Define NO_LIBBIONIC if you do not want bionic support
60#
61# Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
62# for dwarf backtrace post unwind.
58 63
59ifeq ($(srctree),) 64ifeq ($(srctree),)
60srctree := $(patsubst %/,%,$(dir $(shell pwd))) 65srctree := $(patsubst %/,%,$(dir $(shell pwd)))
@@ -208,7 +213,7 @@ LIB_H += ../../include/uapi/linux/perf_event.h
208LIB_H += ../../include/linux/rbtree.h 213LIB_H += ../../include/linux/rbtree.h
209LIB_H += ../../include/linux/list.h 214LIB_H += ../../include/linux/list.h
210LIB_H += ../../include/uapi/linux/const.h 215LIB_H += ../../include/uapi/linux/const.h
211LIB_H += ../../include/linux/hash.h 216LIB_H += ../include/linux/hash.h
212LIB_H += ../../include/linux/stringify.h 217LIB_H += ../../include/linux/stringify.h
213LIB_H += util/include/linux/bitmap.h 218LIB_H += util/include/linux/bitmap.h
214LIB_H += util/include/linux/bitops.h 219LIB_H += util/include/linux/bitops.h
@@ -218,9 +223,7 @@ LIB_H += util/include/linux/ctype.h
218LIB_H += util/include/linux/kernel.h 223LIB_H += util/include/linux/kernel.h
219LIB_H += util/include/linux/list.h 224LIB_H += util/include/linux/list.h
220LIB_H += util/include/linux/export.h 225LIB_H += util/include/linux/export.h
221LIB_H += util/include/linux/magic.h
222LIB_H += util/include/linux/poison.h 226LIB_H += util/include/linux/poison.h
223LIB_H += util/include/linux/prefetch.h
224LIB_H += util/include/linux/rbtree.h 227LIB_H += util/include/linux/rbtree.h
225LIB_H += util/include/linux/rbtree_augmented.h 228LIB_H += util/include/linux/rbtree_augmented.h
226LIB_H += util/include/linux/string.h 229LIB_H += util/include/linux/string.h
@@ -244,7 +247,6 @@ LIB_H += util/cache.h
244LIB_H += util/callchain.h 247LIB_H += util/callchain.h
245LIB_H += util/build-id.h 248LIB_H += util/build-id.h
246LIB_H += util/debug.h 249LIB_H += util/debug.h
247LIB_H += util/fs.h
248LIB_H += util/pmu.h 250LIB_H += util/pmu.h
249LIB_H += util/event.h 251LIB_H += util/event.h
250LIB_H += util/evsel.h 252LIB_H += util/evsel.h
@@ -306,7 +308,6 @@ LIB_OBJS += $(OUTPUT)util/annotate.o
306LIB_OBJS += $(OUTPUT)util/build-id.o 308LIB_OBJS += $(OUTPUT)util/build-id.o
307LIB_OBJS += $(OUTPUT)util/config.o 309LIB_OBJS += $(OUTPUT)util/config.o
308LIB_OBJS += $(OUTPUT)util/ctype.o 310LIB_OBJS += $(OUTPUT)util/ctype.o
309LIB_OBJS += $(OUTPUT)util/fs.o
310LIB_OBJS += $(OUTPUT)util/pmu.o 311LIB_OBJS += $(OUTPUT)util/pmu.o
311LIB_OBJS += $(OUTPUT)util/environment.o 312LIB_OBJS += $(OUTPUT)util/environment.o
312LIB_OBJS += $(OUTPUT)util/event.o 313LIB_OBJS += $(OUTPUT)util/event.o
@@ -408,6 +409,11 @@ endif
408LIB_OBJS += $(OUTPUT)tests/code-reading.o 409LIB_OBJS += $(OUTPUT)tests/code-reading.o
409LIB_OBJS += $(OUTPUT)tests/sample-parsing.o 410LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
410LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o 411LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
412ifndef NO_DWARF_UNWIND
413ifeq ($(ARCH),x86)
414LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o
415endif
416endif
411 417
412BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o 418BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
413BUILTIN_OBJS += $(OUTPUT)builtin-bench.o 419BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
@@ -420,6 +426,9 @@ BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
420endif 426endif
421BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o 427BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
422BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o 428BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
429BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
430BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
431BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
423 432
424BUILTIN_OBJS += $(OUTPUT)builtin-diff.o 433BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
425BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o 434BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
@@ -475,8 +484,13 @@ ifndef NO_DWARF
475endif # NO_DWARF 484endif # NO_DWARF
476endif # NO_LIBELF 485endif # NO_LIBELF
477 486
487ifndef NO_LIBDW_DWARF_UNWIND
488 LIB_OBJS += $(OUTPUT)util/unwind-libdw.o
489 LIB_H += util/unwind-libdw.h
490endif
491
478ifndef NO_LIBUNWIND 492ifndef NO_LIBUNWIND
479 LIB_OBJS += $(OUTPUT)util/unwind.o 493 LIB_OBJS += $(OUTPUT)util/unwind-libunwind.o
480endif 494endif
481LIB_OBJS += $(OUTPUT)tests/keep-tracking.o 495LIB_OBJS += $(OUTPUT)tests/keep-tracking.o
482 496
@@ -533,6 +547,7 @@ ifeq ($(NO_PERF_REGS),0)
533 ifeq ($(ARCH),x86) 547 ifeq ($(ARCH),x86)
534 LIB_H += arch/x86/include/perf_regs.h 548 LIB_H += arch/x86/include/perf_regs.h
535 endif 549 endif
550 LIB_OBJS += $(OUTPUT)util/perf_regs.o
536endif 551endif
537 552
538ifndef NO_LIBNUMA 553ifndef NO_LIBNUMA
@@ -655,6 +670,9 @@ $(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
655 -DPYTHON='"$(PYTHON_WORD)"' \ 670 -DPYTHON='"$(PYTHON_WORD)"' \
656 $< 671 $<
657 672
673$(OUTPUT)tests/dwarf-unwind.o: tests/dwarf-unwind.c
674 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -fno-optimize-sibling-calls $<
675
658$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS 676$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
659 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 677 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
660 678
@@ -707,9 +725,15 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
707# we depend the various files onto their directories. 725# we depend the various files onto their directories.
708DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS) 726DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(GTK_OBJS)
709DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h 727DIRECTORY_DEPS += $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
710$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS))) 728# no need to add flex objects, because they depend on bison ones
729DIRECTORY_DEPS += $(OUTPUT)util/parse-events-bison.c
730DIRECTORY_DEPS += $(OUTPUT)util/pmu-bison.c
731
732OUTPUT_DIRECTORIES := $(sort $(dir $(DIRECTORY_DEPS)))
733
734$(DIRECTORY_DEPS): | $(OUTPUT_DIRECTORIES)
711# In the second step, we make a rule to actually create these directories 735# In the second step, we make a rule to actually create these directories
712$(sort $(dir $(DIRECTORY_DEPS))): 736$(OUTPUT_DIRECTORIES):
713 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null 737 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
714 738
715$(LIB_FILE): $(LIB_OBJS) 739$(LIB_FILE): $(LIB_OBJS)
@@ -886,7 +910,7 @@ config-clean:
886clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean 910clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
887 $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS) 911 $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
888 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf 912 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
889 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* 913 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
890 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean 914 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
891 $(python-clean) 915 $(python-clean)
892 916