aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-03-31 03:27:41 -0400
committerIngo Molnar <mingo@kernel.org>2012-03-31 03:27:41 -0400
commit8ebfdf2babcda5a3b06cc67523bca1f9aed46009 (patch)
tree160fe42903b8fdd399347ae9e7a7d72c331570f8 /tools/perf/Makefile
parent12b5da349a8b94c9dbc3430a6bc42eabd9eaf50b (diff)
parent65f3e56e0c81d1f581c4bdef7646ae5a8d51f494 (diff)
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile47
1 files changed, 30 insertions, 17 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 2f4288638806..820371f10d1b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -61,8 +61,6 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
61 61
62CC = $(CROSS_COMPILE)gcc 62CC = $(CROSS_COMPILE)gcc
63AR = $(CROSS_COMPILE)ar 63AR = $(CROSS_COMPILE)ar
64FLEX = $(CROSS_COMPILE)flex
65BISON= $(CROSS_COMPILE)bison
66 64
67# Additional ARCH settings for x86 65# Additional ARCH settings for x86
68ifeq ($(ARCH),i386) 66ifeq ($(ARCH),i386)
@@ -184,7 +182,7 @@ endif
184 182
185### --- END CONFIGURATION SECTION --- 183### --- END CONFIGURATION SECTION ---
186 184
187BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 185BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)/util -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
188BASIC_LDFLAGS = 186BASIC_LDFLAGS =
189 187
190# Guard against environment variables 188# Guard against environment variables
@@ -236,6 +234,25 @@ endif
236 234
237export PERL_PATH 235export PERL_PATH
238 236
237FLEX = $(CROSS_COMPILE)flex
238BISON= $(CROSS_COMPILE)bison
239
240event-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
247pmu-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
239LIB_FILE=$(OUTPUT)libperf.a 256LIB_FILE=$(OUTPUT)libperf.a
240 257
241LIB_H += ../../include/linux/perf_event.h 258LIB_H += ../../include/linux/perf_event.h
@@ -754,6 +771,15 @@ $(OUTPUT)perf.o perf.spec \
754.SUFFIXES: 771.SUFFIXES:
755.SUFFIXES: .o .c .S .s 772.SUFFIXES: .o .c .S .s
756 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
757$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS 783$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
758 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< 784 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
759$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS 785$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
@@ -790,12 +816,6 @@ $(OUTPUT)util/ui/browsers/map.o: util/ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
790$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS 816$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
791 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 817 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
792 818
793$(OUTPUT)util/parse-events-flex.o: util/parse-events-flex.c $(OUTPUT)PERF-CFLAGS
794 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
795
796$(OUTPUT)util/pmu-flex.o: util/pmu-flex.c $(OUTPUT)PERF-CFLAGS
797 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
798
799$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS 819$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
800 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 820 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
801 821
@@ -883,14 +903,6 @@ cscope:
883 $(RM) cscope* 903 $(RM) cscope*
884 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b 904 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
885 905
886event-parser:
887 $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c
888 $(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c
889
890pmu-parser:
891 $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o util/pmu-bison.c
892 $(QUIET_FLEX)$(FLEX) --header-file=util/pmu-flex.h -t util/pmu.l > util/pmu-flex.c
893
894### Detect prefix changes 906### Detect prefix changes
895TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ 907TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
896 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) 908 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
@@ -978,6 +990,7 @@ clean:
978 $(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*
979 $(MAKE) -C Documentation/ clean 991 $(MAKE) -C Documentation/ clean
980 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS 992 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
993 $(RM) $(OUTPUT)util/*-{bison,flex}*
981 $(python-clean) 994 $(python-clean)
982 995
983.PHONY: all install clean strip 996.PHONY: all install clean strip