diff options
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 74fd7f89208a..820371f10d1b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -182,7 +182,7 @@ endif | |||
182 | 182 | ||
183 | ### --- END CONFIGURATION SECTION --- | 183 | ### --- END CONFIGURATION SECTION --- |
184 | 184 | ||
185 | BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 185 | BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)/util -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
186 | BASIC_LDFLAGS = | 186 | BASIC_LDFLAGS = |
187 | 187 | ||
188 | # Guard against environment variables | 188 | # Guard against environment variables |
@@ -234,6 +234,25 @@ endif | |||
234 | 234 | ||
235 | export PERL_PATH | 235 | export PERL_PATH |
236 | 236 | ||
237 | FLEX = $(CROSS_COMPILE)flex | ||
238 | BISON= $(CROSS_COMPILE)bison | ||
239 | |||
240 | event-parser: | ||
241 | $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o $(OUTPUT)util/parse-events-bison.c | ||
242 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c | ||
243 | |||
244 | $(OUTPUT)util/parse-events-flex.c: event-parser | ||
245 | $(OUTPUT)util/parse-events-bison.c: event-parser | ||
246 | |||
247 | pmu-parser: | ||
248 | $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c | ||
249 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c | ||
250 | |||
251 | $(OUTPUT)util/pmu-flex.c: pmu-parser | ||
252 | $(OUTPUT)util/pmu-bison.c: pmu-parser | ||
253 | |||
254 | $(OUTPUT)util/parse-events.o: event-parser pmu-parser | ||
255 | |||
237 | LIB_FILE=$(OUTPUT)libperf.a | 256 | LIB_FILE=$(OUTPUT)libperf.a |
238 | 257 | ||
239 | LIB_H += ../../include/linux/perf_event.h | 258 | LIB_H += ../../include/linux/perf_event.h |
@@ -249,7 +268,7 @@ LIB_H += util/include/linux/const.h | |||
249 | LIB_H += util/include/linux/ctype.h | 268 | LIB_H += util/include/linux/ctype.h |
250 | LIB_H += util/include/linux/kernel.h | 269 | LIB_H += util/include/linux/kernel.h |
251 | LIB_H += util/include/linux/list.h | 270 | LIB_H += util/include/linux/list.h |
252 | LIB_H += util/include/linux/module.h | 271 | LIB_H += util/include/linux/export.h |
253 | LIB_H += util/include/linux/poison.h | 272 | LIB_H += util/include/linux/poison.h |
254 | LIB_H += util/include/linux/prefetch.h | 273 | LIB_H += util/include/linux/prefetch.h |
255 | LIB_H += util/include/linux/rbtree.h | 274 | LIB_H += util/include/linux/rbtree.h |
@@ -276,6 +295,7 @@ LIB_H += util/build-id.h | |||
276 | LIB_H += util/debug.h | 295 | LIB_H += util/debug.h |
277 | LIB_H += util/debugfs.h | 296 | LIB_H += util/debugfs.h |
278 | LIB_H += util/sysfs.h | 297 | LIB_H += util/sysfs.h |
298 | LIB_H += util/pmu.h | ||
279 | LIB_H += util/event.h | 299 | LIB_H += util/event.h |
280 | LIB_H += util/evsel.h | 300 | LIB_H += util/evsel.h |
281 | LIB_H += util/evlist.h | 301 | LIB_H += util/evlist.h |
@@ -323,6 +343,7 @@ LIB_OBJS += $(OUTPUT)util/config.o | |||
323 | LIB_OBJS += $(OUTPUT)util/ctype.o | 343 | LIB_OBJS += $(OUTPUT)util/ctype.o |
324 | LIB_OBJS += $(OUTPUT)util/debugfs.o | 344 | LIB_OBJS += $(OUTPUT)util/debugfs.o |
325 | LIB_OBJS += $(OUTPUT)util/sysfs.o | 345 | LIB_OBJS += $(OUTPUT)util/sysfs.o |
346 | LIB_OBJS += $(OUTPUT)util/pmu.o | ||
326 | LIB_OBJS += $(OUTPUT)util/environment.o | 347 | LIB_OBJS += $(OUTPUT)util/environment.o |
327 | LIB_OBJS += $(OUTPUT)util/event.o | 348 | LIB_OBJS += $(OUTPUT)util/event.o |
328 | LIB_OBJS += $(OUTPUT)util/evlist.o | 349 | LIB_OBJS += $(OUTPUT)util/evlist.o |
@@ -359,6 +380,10 @@ LIB_OBJS += $(OUTPUT)util/session.o | |||
359 | LIB_OBJS += $(OUTPUT)util/thread.o | 380 | LIB_OBJS += $(OUTPUT)util/thread.o |
360 | LIB_OBJS += $(OUTPUT)util/thread_map.o | 381 | LIB_OBJS += $(OUTPUT)util/thread_map.o |
361 | LIB_OBJS += $(OUTPUT)util/trace-event-parse.o | 382 | LIB_OBJS += $(OUTPUT)util/trace-event-parse.o |
383 | LIB_OBJS += $(OUTPUT)util/parse-events-flex.o | ||
384 | LIB_OBJS += $(OUTPUT)util/parse-events-bison.o | ||
385 | LIB_OBJS += $(OUTPUT)util/pmu-flex.o | ||
386 | LIB_OBJS += $(OUTPUT)util/pmu-bison.o | ||
362 | LIB_OBJS += $(OUTPUT)util/trace-event-read.o | 387 | LIB_OBJS += $(OUTPUT)util/trace-event-read.o |
363 | LIB_OBJS += $(OUTPUT)util/trace-event-info.o | 388 | LIB_OBJS += $(OUTPUT)util/trace-event-info.o |
364 | LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o | 389 | LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o |
@@ -501,6 +526,20 @@ else | |||
501 | endif | 526 | endif |
502 | endif | 527 | endif |
503 | 528 | ||
529 | ifdef NO_GTK2 | ||
530 | BASIC_CFLAGS += -DNO_GTK2 | ||
531 | else | ||
532 | FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0) | ||
533 | ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y) | ||
534 | msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); | ||
535 | BASIC_CFLAGS += -DNO_GTK2_SUPPORT | ||
536 | else | ||
537 | BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0) | ||
538 | EXTLIBS += $(shell pkg-config --libs gtk+-2.0) | ||
539 | LIB_OBJS += $(OUTPUT)util/gtk/browser.o | ||
540 | endif | ||
541 | endif | ||
542 | |||
504 | ifdef NO_LIBPERL | 543 | ifdef NO_LIBPERL |
505 | BASIC_CFLAGS += -DNO_LIBPERL | 544 | BASIC_CFLAGS += -DNO_LIBPERL |
506 | else | 545 | else |
@@ -647,6 +686,8 @@ ifndef V | |||
647 | QUIET_LINK = @echo ' ' LINK $@; | 686 | QUIET_LINK = @echo ' ' LINK $@; |
648 | QUIET_MKDIR = @echo ' ' MKDIR $@; | 687 | QUIET_MKDIR = @echo ' ' MKDIR $@; |
649 | QUIET_GEN = @echo ' ' GEN $@; | 688 | QUIET_GEN = @echo ' ' GEN $@; |
689 | QUIET_FLEX = @echo ' ' FLEX $@; | ||
690 | QUIET_BISON = @echo ' ' BISON $@; | ||
650 | endif | 691 | endif |
651 | endif | 692 | endif |
652 | 693 | ||
@@ -727,12 +768,28 @@ $(OUTPUT)perf.o perf.spec \ | |||
727 | $(SCRIPTS) \ | 768 | $(SCRIPTS) \ |
728 | : $(OUTPUT)PERF-VERSION-FILE | 769 | : $(OUTPUT)PERF-VERSION-FILE |
729 | 770 | ||
771 | .SUFFIXES: | ||
772 | .SUFFIXES: .o .c .S .s | ||
773 | |||
774 | # These two need to be here so that when O= is not used they take precedence | ||
775 | # over the general rule for .o | ||
776 | |||
777 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS | ||
778 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | ||
779 | |||
780 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS | ||
781 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | ||
782 | |||
730 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS | 783 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS |
731 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 784 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
785 | $(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS | ||
786 | $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $< | ||
732 | $(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS | 787 | $(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS |
733 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< | 788 | $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $< |
734 | $(OUTPUT)%.o: %.S | 789 | $(OUTPUT)%.o: %.S |
735 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 790 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
791 | $(OUTPUT)%.s: %.S | ||
792 | $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $< | ||
736 | 793 | ||
737 | $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS | 794 | $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS |
738 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ | 795 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ |
@@ -795,6 +852,8 @@ help: | |||
795 | @echo ' html - make html documentation' | 852 | @echo ' html - make html documentation' |
796 | @echo ' info - make GNU info documentation (access with info <foo>)' | 853 | @echo ' info - make GNU info documentation (access with info <foo>)' |
797 | @echo ' pdf - make pdf documentation' | 854 | @echo ' pdf - make pdf documentation' |
855 | @echo ' event-parser - make event parser code' | ||
856 | @echo ' pmu-parser - make pmu format parser code' | ||
798 | @echo ' TAGS - use etags to make tag information for source browsing' | 857 | @echo ' TAGS - use etags to make tag information for source browsing' |
799 | @echo ' tags - use ctags to make tag information for source browsing' | 858 | @echo ' tags - use ctags to make tag information for source browsing' |
800 | @echo ' cscope - use cscope to make interactive browsing database' | 859 | @echo ' cscope - use cscope to make interactive browsing database' |
@@ -931,6 +990,7 @@ clean: | |||
931 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* | 990 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* |
932 | $(MAKE) -C Documentation/ clean | 991 | $(MAKE) -C Documentation/ clean |
933 | $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS | 992 | $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS |
993 | $(RM) $(OUTPUT)util/*-{bison,flex}* | ||
934 | $(python-clean) | 994 | $(python-clean) |
935 | 995 | ||
936 | .PHONY: all install clean strip | 996 | .PHONY: all install clean strip |