aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 46150ab073c7..af0e5d64a9f7 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -149,7 +149,7 @@ endif
149 149
150### --- END CONFIGURATION SECTION --- 150### --- END CONFIGURATION SECTION ---
151 151
152BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)/util -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 152BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)/util -I$(EVENT_PARSE_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
153BASIC_LDFLAGS = 153BASIC_LDFLAGS =
154 154
155# Guard against environment variables 155# Guard against environment variables
@@ -179,7 +179,15 @@ $(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
179SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) 179SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
180 180
181EVENT_PARSE_DIR = ../lib/traceevent/ 181EVENT_PARSE_DIR = ../lib/traceevent/
182LIBTRACEEVENT = $(OUTPUT)$(EVENT_PARSE_DIR)libtraceevent.a 182
183ifeq ("$(origin O)", "command line")
184 EP_PATH=$(OUTPUT)/
185else
186 EP_PATH=$(EVENT_PARSE_DIR)/
187endif
188
189LIBPARSEVENT = $(EP_PATH)libtraceevent.a
190EP_LIB := -L$(EP_PATH) -ltraceevent
183 191
184# 192#
185# Single 'perf' binary right now: 193# Single 'perf' binary right now:
@@ -295,7 +303,6 @@ LIB_H += util/hist.h
295LIB_H += util/thread.h 303LIB_H += util/thread.h
296LIB_H += util/thread_map.h 304LIB_H += util/thread_map.h
297LIB_H += util/trace-event.h 305LIB_H += util/trace-event.h
298LIB_H += util/trace-parse-events.h
299LIB_H += util/probe-finder.h 306LIB_H += util/probe-finder.h
300LIB_H += util/dwarf-aux.h 307LIB_H += util/dwarf-aux.h
301LIB_H += util/probe-event.h 308LIB_H += util/probe-event.h
@@ -358,7 +365,6 @@ LIB_OBJS += $(OUTPUT)util/pmu-bison.o
358LIB_OBJS += $(OUTPUT)util/trace-event-read.o 365LIB_OBJS += $(OUTPUT)util/trace-event-read.o
359LIB_OBJS += $(OUTPUT)util/trace-event-info.o 366LIB_OBJS += $(OUTPUT)util/trace-event-info.o
360LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o 367LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
361LIB_OBJS += $(OUTPUT)util/trace-parse-events.o
362LIB_OBJS += $(OUTPUT)util/svghelper.o 368LIB_OBJS += $(OUTPUT)util/svghelper.o
363LIB_OBJS += $(OUTPUT)util/sort.o 369LIB_OBJS += $(OUTPUT)util/sort.o
364LIB_OBJS += $(OUTPUT)util/hist.o 370LIB_OBJS += $(OUTPUT)util/hist.o
@@ -402,7 +408,7 @@ BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
402BUILTIN_OBJS += $(OUTPUT)builtin-test.o 408BUILTIN_OBJS += $(OUTPUT)builtin-test.o
403BUILTIN_OBJS += $(OUTPUT)builtin-inject.o 409BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
404 410
405PERFLIBS = $(LIB_FILE) 411PERFLIBS = $(LIB_FILE) $(LIBPARSEVENT)
406 412
407# Files needed for the python binding, perf.so 413# Files needed for the python binding, perf.so
408# pyrf is just an internal name needed for all those wrappers. 414# pyrf is just an internal name needed for all those wrappers.
@@ -699,7 +705,7 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
699 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 705 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
700 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@ 706 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
701 707
702$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(LIBTRACEEVENT) 708$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
703 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \ 709 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
704 $(BUILTIN_OBJS) $(LIBS) -o $@ 710 $(BUILTIN_OBJS) $(LIBS) -o $@
705 711
@@ -806,7 +812,7 @@ $(LIB_FILE): $(LIB_OBJS)
806 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) 812 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
807 813
808# libparsevent.a 814# libparsevent.a
809$(LIBTRACEEVENT): 815$(LIBPARSEVENT):
810 make -C $(EVENT_PARSE_DIR) $(COMMAND_O) libtraceevent.a 816 make -C $(EVENT_PARSE_DIR) $(COMMAND_O) libtraceevent.a
811 817
812help: 818help: