aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile51
1 files changed, 38 insertions, 13 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 2e7fa3a06806..54a5b50ff312 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -286,11 +286,7 @@ SCRIPT_PERL =
286SCRIPT_SH = 286SCRIPT_SH =
287TEST_PROGRAMS = 287TEST_PROGRAMS =
288 288
289# 289SCRIPT_SH += perf-archive.sh
290# No scripts right now:
291#
292
293# SCRIPT_SH += perf-am.sh
294 290
295# 291#
296# No Perl scripts right now: 292# No Perl scripts right now:
@@ -315,9 +311,6 @@ PROGRAMS += perf
315# List built-in command $C whose implementation cmd_$C() is not in 311# List built-in command $C whose implementation cmd_$C() is not in
316# builtin-$C.o but is linked in as part of some other command. 312# builtin-$C.o but is linked in as part of some other command.
317# 313#
318# None right now:
319#
320# BUILT_INS += perf-init $X
321 314
322# what 'all' will build and 'install' will install, in perfexecdir 315# what 'all' will build and 'install' will install, in perfexecdir
323ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) 316ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
@@ -340,6 +333,7 @@ LIB_FILE=libperf.a
340LIB_H += ../../include/linux/perf_event.h 333LIB_H += ../../include/linux/perf_event.h
341LIB_H += ../../include/linux/rbtree.h 334LIB_H += ../../include/linux/rbtree.h
342LIB_H += ../../include/linux/list.h 335LIB_H += ../../include/linux/list.h
336LIB_H += ../../include/linux/hash.h
343LIB_H += ../../include/linux/stringify.h 337LIB_H += ../../include/linux/stringify.h
344LIB_H += util/include/linux/bitmap.h 338LIB_H += util/include/linux/bitmap.h
345LIB_H += util/include/linux/bitops.h 339LIB_H += util/include/linux/bitops.h
@@ -363,12 +357,14 @@ LIB_H += util/include/asm/uaccess.h
363LIB_H += perf.h 357LIB_H += perf.h
364LIB_H += util/cache.h 358LIB_H += util/cache.h
365LIB_H += util/callchain.h 359LIB_H += util/callchain.h
360LIB_H += util/build-id.h
366LIB_H += util/debug.h 361LIB_H += util/debug.h
367LIB_H += util/debugfs.h 362LIB_H += util/debugfs.h
368LIB_H += util/event.h 363LIB_H += util/event.h
369LIB_H += util/exec_cmd.h 364LIB_H += util/exec_cmd.h
370LIB_H += util/types.h 365LIB_H += util/types.h
371LIB_H += util/levenshtein.h 366LIB_H += util/levenshtein.h
367LIB_H += util/map.h
372LIB_H += util/parse-options.h 368LIB_H += util/parse-options.h
373LIB_H += util/parse-events.h 369LIB_H += util/parse-events.h
374LIB_H += util/quote.h 370LIB_H += util/quote.h
@@ -389,12 +385,12 @@ LIB_H += util/sort.h
389LIB_H += util/hist.h 385LIB_H += util/hist.h
390LIB_H += util/thread.h 386LIB_H += util/thread.h
391LIB_H += util/trace-event.h 387LIB_H += util/trace-event.h
392LIB_H += util/trace-event-perl.h
393LIB_H += util/probe-finder.h 388LIB_H += util/probe-finder.h
394LIB_H += util/probe-event.h 389LIB_H += util/probe-event.h
395 390
396LIB_OBJS += util/abspath.o 391LIB_OBJS += util/abspath.o
397LIB_OBJS += util/alias.o 392LIB_OBJS += util/alias.o
393LIB_OBJS += util/build-id.o
398LIB_OBJS += util/config.o 394LIB_OBJS += util/config.o
399LIB_OBJS += util/ctype.o 395LIB_OBJS += util/ctype.o
400LIB_OBJS += util/debugfs.o 396LIB_OBJS += util/debugfs.o
@@ -431,12 +427,12 @@ LIB_OBJS += util/thread.o
431LIB_OBJS += util/trace-event-parse.o 427LIB_OBJS += util/trace-event-parse.o
432LIB_OBJS += util/trace-event-read.o 428LIB_OBJS += util/trace-event-read.o
433LIB_OBJS += util/trace-event-info.o 429LIB_OBJS += util/trace-event-info.o
434LIB_OBJS += util/trace-event-perl.o 430LIB_OBJS += util/trace-event-scripting.o
435LIB_OBJS += util/svghelper.o 431LIB_OBJS += util/svghelper.o
436LIB_OBJS += util/sort.o 432LIB_OBJS += util/sort.o
437LIB_OBJS += util/hist.o 433LIB_OBJS += util/hist.o
438LIB_OBJS += util/data_map.o
439LIB_OBJS += util/probe-event.o 434LIB_OBJS += util/probe-event.o
435LIB_OBJS += util/util.o
440 436
441BUILTIN_OBJS += builtin-annotate.o 437BUILTIN_OBJS += builtin-annotate.o
442 438
@@ -451,6 +447,7 @@ BUILTIN_OBJS += builtin-diff.o
451BUILTIN_OBJS += builtin-help.o 447BUILTIN_OBJS += builtin-help.o
452BUILTIN_OBJS += builtin-sched.o 448BUILTIN_OBJS += builtin-sched.o
453BUILTIN_OBJS += builtin-buildid-list.o 449BUILTIN_OBJS += builtin-buildid-list.o
450BUILTIN_OBJS += builtin-buildid-cache.o
454BUILTIN_OBJS += builtin-list.o 451BUILTIN_OBJS += builtin-list.o
455BUILTIN_OBJS += builtin-record.o 452BUILTIN_OBJS += builtin-record.o
456BUILTIN_OBJS += builtin-report.o 453BUILTIN_OBJS += builtin-report.o
@@ -460,6 +457,7 @@ BUILTIN_OBJS += builtin-top.o
460BUILTIN_OBJS += builtin-trace.o 457BUILTIN_OBJS += builtin-trace.o
461BUILTIN_OBJS += builtin-probe.o 458BUILTIN_OBJS += builtin-probe.o
462BUILTIN_OBJS += builtin-kmem.o 459BUILTIN_OBJS += builtin-kmem.o
460BUILTIN_OBJS += builtin-lock.o
463 461
464PERFLIBS = $(LIB_FILE) 462PERFLIBS = $(LIB_FILE)
465 463
@@ -520,9 +518,23 @@ ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; e
520 BASIC_CFLAGS += -DNO_LIBPERL 518 BASIC_CFLAGS += -DNO_LIBPERL
521else 519else
522 ALL_LDFLAGS += $(PERL_EMBED_LDOPTS) 520 ALL_LDFLAGS += $(PERL_EMBED_LDOPTS)
521 LIB_OBJS += util/scripting-engines/trace-event-perl.o
523 LIB_OBJS += scripts/perl/Perf-Trace-Util/Context.o 522 LIB_OBJS += scripts/perl/Perf-Trace-Util/Context.o
524endif 523endif
525 524
525ifndef NO_LIBPYTHON
526PYTHON_EMBED_LDOPTS = `python-config --ldflags 2>/dev/null`
527PYTHON_EMBED_CCOPTS = `python-config --cflags 2>/dev/null`
528endif
529
530ifneq ($(shell sh -c "(echo '\#include <Python.h>'; echo 'int main(void) { Py_Initialize(); return 0; }') | $(CC) -x c - $(PYTHON_EMBED_CCOPTS) -o /dev/null $(PYTHON_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y)
531 BASIC_CFLAGS += -DNO_LIBPYTHON
532else
533 ALL_LDFLAGS += $(PYTHON_EMBED_LDOPTS)
534 LIB_OBJS += util/scripting-engines/trace-event-python.o
535 LIB_OBJS += scripts/python/Perf-Trace-Util/Context.o
536endif
537
526ifdef NO_DEMANGLE 538ifdef NO_DEMANGLE
527 BASIC_CFLAGS += -DNO_DEMANGLE 539 BASIC_CFLAGS += -DNO_DEMANGLE
528else 540else
@@ -894,12 +906,18 @@ util/hweight.o: ../../lib/hweight.c PERF-CFLAGS
894util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS 906util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS
895 $(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 907 $(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
896 908
897util/trace-event-perl.o: util/trace-event-perl.c PERF-CFLAGS 909util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c PERF-CFLAGS
898 $(QUIET_CC)$(CC) -o util/trace-event-perl.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 910 $(QUIET_CC)$(CC) -o util/scripting-engines/trace-event-perl.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
899 911
900scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c PERF-CFLAGS 912scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c PERF-CFLAGS
901 $(QUIET_CC)$(CC) -o scripts/perl/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 913 $(QUIET_CC)$(CC) -o scripts/perl/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
902 914
915util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c PERF-CFLAGS
916 $(QUIET_CC)$(CC) -o util/scripting-engines/trace-event-python.o -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
917
918scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c PERF-CFLAGS
919 $(QUIET_CC)$(CC) -o scripts/python/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
920
903perf-%$X: %.o $(PERFLIBS) 921perf-%$X: %.o $(PERFLIBS)
904 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 922 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
905 923
@@ -1009,9 +1027,16 @@ install: all
1009 $(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)' 1027 $(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
1010 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 1028 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
1011 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' 1029 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
1030 $(INSTALL) perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1012 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 1031 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
1013 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl' 1032 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
1014 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' 1033 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
1034 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
1035 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
1036 $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
1037 $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
1038 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
1039
1015ifdef BUILT_INS 1040ifdef BUILT_INS
1016 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 1041 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1017 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 1042 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'