blob: e0d3d9f9677147694bb46eae0cd62d2601a2d276 [file] [log] [blame]
Borislav Petkov98d89bf2012-04-11 18:36:14 +02001include ../scripts/Makefile.include
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -03002
Ingo Molnard24e4732009-04-20 13:32:07 +02003# The default target of this Makefile is...
Michael Wittena3d1ee12011-02-02 14:22:08 -06004all:
Ingo Molnare0143ba2009-03-23 21:29:59 +01005
Michael Wittenced465c2011-04-02 21:46:09 +00006include config/utilities.mak
7
Michael Wittena3d1ee12011-02-02 14:22:08 -06008# Define V to have a more verbose compile.
Ingo Molnard24e4732009-04-20 13:32:07 +02009#
Namhyung Kim67cbbd72012-02-23 16:08:14 +090010# Define O to save output files in a separate directory.
11#
12# Define ARCH as name of target architecture if you want cross-builds.
13#
14# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
15#
16# Define NO_LIBPERL to disable perl script extension.
17#
18# Define NO_LIBPYTHON to disable python script extension.
19#
Michael Wittenced465c2011-04-02 21:46:09 +000020# Define PYTHON to point to the python binary if the default
21# `python' is not correct; for example: PYTHON=python2
22#
23# Define PYTHON_CONFIG to point to the python-config binary if
24# the default `$(PYTHON)-config' is not correct.
25#
Ingo Molnard24e4732009-04-20 13:32:07 +020026# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
27#
28# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
29#
Michael S. Tsirkin75138652009-10-29 17:20:02 +020030# Define LDFLAGS=-static to build a static binary.
Michael S. Tsirkin81516c52009-11-22 14:13:35 +020031#
32# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
Masami Hiramatsuca721e42010-03-22 13:10:27 -030033#
34# Define NO_DWARF if you do not want debug-info analysis feature at all.
Darren Hart9e59e092011-09-08 13:42:39 -070035#
36# Define WERROR=0 to disable treating any warnings as errors.
Namhyung Kim67cbbd72012-02-23 16:08:14 +090037#
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -030038# Define NO_NEWT if you do not want TUI support. (deprecated)
39#
40# Define NO_SLANG if you do not want TUI support.
Namhyung Kim67cbbd72012-02-23 16:08:14 +090041#
Namhyung Kim393be2e2012-08-06 13:41:21 +090042# Define NO_GTK2 if you do not want GTK+ GUI support.
43#
Namhyung Kim67cbbd72012-02-23 16:08:14 +090044# Define NO_DEMANGLE if you do not want C++ symbol demangling.
Namhyung Kim393be2e2012-08-06 13:41:21 +090045#
46# Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
47#
Jiri Olsa6a40cd92012-08-07 15:20:44 +020048# Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
49# backtrace post unwind.
Namhyung Kim4e34d952012-10-02 01:32:51 +090050#
51# Define NO_BACKTRACE if you do not want stack backtrace debug feature
Peter Hurley79d824e2013-01-27 20:51:22 -050052#
53# Define NO_LIBNUMA if you do not want numa perf benchmark
Jiri Olsa4e22db42013-05-24 14:35:24 +020054#
55# Define NO_LIBAUDIT if you do not want libaudit support
56#
57# Define NO_LIBBIONIC if you do not want bionic support
Ingo Molnare0143ba2009-03-23 21:29:59 +010058
Jiri Olsa362493f2013-03-25 00:40:48 +010059ifeq ($(srctree),)
60srctree := $(patsubst %/,%,$(dir $(shell pwd)))
61srctree := $(patsubst %/,%,$(dir $(srctree)))
62#$(info Determined 'srctree' to be $(srctree))
63endif
64
65ifneq ($(objtree),)
66#$(info Determined 'objtree' to be $(objtree))
67endif
68
69ifneq ($(OUTPUT),)
70#$(info Determined 'OUTPUT' to be $(OUTPUT))
71endif
72
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -030073$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
74 @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
Ingo Molnare0143ba2009-03-23 21:29:59 +010075
Lin Ming174a7b1f2011-05-07 12:41:14 +080076CC = $(CROSS_COMPILE)gcc
77AR = $(CROSS_COMPILE)ar
78
Jiri Olsaa32f4932013-03-25 00:32:01 +010079RM = rm -f
80MKDIR = mkdir
81FIND = find
82INSTALL = install
83FLEX = flex
84BISON = bison
Jiri Olsa0dce60f2013-04-15 04:49:43 +020085STRIP = strip
Jiri Olsaa32f4932013-03-25 00:32:01 +010086
Jiri Olsa7c537462013-05-24 14:35:23 +020087LK_DIR = $(srctree)/tools/lib/lk/
88TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
Jiri Olsa362493f2013-03-25 00:40:48 +010089
Jiri Olsa8bd407b2013-03-15 16:28:49 +010090# include config/Makefile by default and rule out
91# non-config cases
92config := 1
93
94NON_CONFIG_TARGETS := clean TAGS tags cscope help
95
96ifdef MAKECMDGOALS
97ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
98 config := 0
Ian Munsiecd932c52010-04-20 16:58:32 +100099endif
Jiri Olsa8bd407b2013-03-15 16:28:49 +0100100endif
101
102ifeq ($(config),1)
103include config/Makefile
Ian Munsiecd932c52010-04-20 16:58:32 +1000104endif
105
Ingo Molnard24e4732009-04-20 13:32:07 +0200106export prefix bindir sharedir sysconfdir
107
Ingo Molnard24e4732009-04-20 13:32:07 +0200108# sparse is architecture-neutral, which means that we need to tell it
109# explicitly what architecture to check for. Fix this up for yours..
110SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
111
Ingo Molnard24e4732009-04-20 13:32:07 +0200112# Guard against environment variables
113BUILTIN_OBJS =
Ingo Molnard24e4732009-04-20 13:32:07 +0200114LIB_H =
115LIB_OBJS =
Arnaldo Carvalho de Melo877108e2011-01-29 15:44:29 -0200116PYRF_OBJS =
Ingo Molnard24e4732009-04-20 13:32:07 +0200117SCRIPT_SH =
Ingo Molnard24e4732009-04-20 13:32:07 +0200118
Arnaldo Carvalho de Melo2c585172010-01-15 13:17:52 -0200119SCRIPT_SH += perf-archive.sh
Ingo Molnar07800602009-04-20 15:00:56 +0200120
Tom Zanussif2481f32010-08-24 00:23:50 -0500121grep-libs = $(filter -l%,$(1))
122strip-libs = $(filter-out -l%,$(1))
123
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300124ifneq ($(OUTPUT),)
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200125 TE_PATH=$(OUTPUT)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100126ifneq ($(subdir),)
Robert Richterab4ecda2013-07-16 16:50:36 +0200127 LK_PATH=$(OUTPUT)/../lib/lk/
Borislav Petkov85c66be2013-02-20 16:32:30 +0100128else
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200129 LK_PATH=$(OUTPUT)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100130endif
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300131else
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200132 TE_PATH=$(TRACE_EVENT_DIR)
Robert Richter107de372013-06-11 17:22:38 +0200133 LK_PATH=$(LK_DIR)
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300134endif
135
136LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900137export LIBTRACEEVENT
138
Borislav Petkov85c66be2013-02-20 16:32:30 +0100139LIBLK = $(LK_PATH)liblk.a
140export LIBLK
141
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900142# python extension build directories
143PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
144PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
145PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
146export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
147
148python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
149
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900150PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
Jiri Olsac3c44702013-04-15 05:54:14 +0200151PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBLK)
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900152
Namhyung Kime4898332012-09-28 18:31:58 +0900153$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100154 $(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200155 --quiet build_ext; \
156 mkdir -p $(OUTPUT)python && \
157 cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
Ingo Molnar07800602009-04-20 15:00:56 +0200158#
159# No Perl scripts right now:
160#
161
Michael Witten0a54fb62011-02-02 12:04:27 -0600162SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
Ingo Molnard24e4732009-04-20 13:32:07 +0200163
Ingo Molnar07800602009-04-20 15:00:56 +0200164#
Ingo Molnar125e7022009-04-20 16:13:46 +0200165# Single 'perf' binary right now:
Ingo Molnar07800602009-04-20 15:00:56 +0200166#
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300167PROGRAMS += $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200168
Ingo Molnar07800602009-04-20 15:00:56 +0200169# what 'all' will build and 'install' will install, in perfexecdir
Arnaldo Carvalho de Melo978f6262011-02-01 16:40:51 -0200170ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200171
Ingo Molnar07800602009-04-20 15:00:56 +0200172# what 'all' will build but not install in perfexecdir
Michael Witten8796cb92011-02-02 11:57:41 -0600173OTHER_PROGRAMS = $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200174
175# Set paths to tools early so that they can be used for version tests.
176ifndef SHELL_PATH
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200177 SHELL_PATH = /bin/sh
Ingo Molnard24e4732009-04-20 13:32:07 +0200178endif
179ifndef PERL_PATH
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200180 PERL_PATH = /usr/bin/perl
Ingo Molnard24e4732009-04-20 13:32:07 +0200181endif
182
183export PERL_PATH
184
Eric Sandeene6048fb2012-09-20 21:31:44 -0500185$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
Jiri Olsa82ba1f22012-05-21 09:12:50 +0200186 $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300187
Jiri Olsa024e6c92012-04-11 12:39:51 +0200188$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800189 $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
Ingo Molnar65f3e562012-03-29 13:08:38 -0300190
Eric Sandeene6048fb2012-09-20 21:31:44 -0500191$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300192 $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
193
Jiri Olsa024e6c92012-04-11 12:39:51 +0200194$(OUTPUT)util/pmu-bison.c: util/pmu.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800195 $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
Ingo Molnar65f3e562012-03-29 13:08:38 -0300196
Jiri Olsa024e6c92012-04-11 12:39:51 +0200197$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
198$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300199
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300200LIB_FILE=$(OUTPUT)libperf.a
Ingo Molnard24e4732009-04-20 13:32:07 +0200201
Ingo Molnar7d380c82012-10-14 10:40:57 +0200202LIB_H += ../../include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300203LIB_H += ../../include/linux/rbtree.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300204LIB_H += ../../include/linux/list.h
Ingo Molnar7d380c82012-10-14 10:40:57 +0200205LIB_H += ../../include/uapi/linux/const.h
Hitoshi Mitake18e97e02010-01-30 20:43:24 +0900206LIB_H += ../../include/linux/hash.h
Masami Hiramatsu97698332009-10-16 20:08:18 -0400207LIB_H += ../../include/linux/stringify.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200208LIB_H += util/include/linux/bitmap.h
209LIB_H += util/include/linux/bitops.h
210LIB_H += util/include/linux/compiler.h
Arnaldo Carvalho de Melo75911c92011-05-26 10:13:38 -0300211LIB_H += util/include/linux/const.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200212LIB_H += util/include/linux/ctype.h
213LIB_H += util/include/linux/kernel.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300214LIB_H += util/include/linux/list.h
Jiri Olsa2c86bf12012-03-26 11:17:05 +0200215LIB_H += util/include/linux/export.h
Irina Tirdeaf8fcd772012-09-11 01:14:58 +0300216LIB_H += util/include/linux/magic.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200217LIB_H += util/include/linux/poison.h
218LIB_H += util/include/linux/prefetch.h
219LIB_H += util/include/linux/rbtree.h
Markus Trippelsdorf871a0592012-10-09 20:01:56 +0200220LIB_H += util/include/linux/rbtree_augmented.h
Arnaldo Carvalho de Melo20639c12009-10-19 15:11:36 -0200221LIB_H += util/include/linux/string.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200222LIB_H += util/include/linux/types.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900223LIB_H += util/include/linux/linkage.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200224LIB_H += util/include/asm/asm-offsets.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200225LIB_H += util/include/asm/bug.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200226LIB_H += util/include/asm/byteorder.h
Arnaldo Carvalho de Melofb720142010-04-30 19:31:12 -0300227LIB_H += util/include/asm/hweight.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200228LIB_H += util/include/asm/swab.h
229LIB_H += util/include/asm/system.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200230LIB_H += util/include/asm/uaccess.h
Ian Munsiecd932c52010-04-20 16:58:32 +1000231LIB_H += util/include/dwarf-regs.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900232LIB_H += util/include/asm/dwarf2.h
233LIB_H += util/include/asm/cpufeature.h
Ingo Molnareae7a752012-03-14 12:42:34 -0300234LIB_H += util/include/asm/unistd_32.h
235LIB_H += util/include/asm/unistd_64.h
Thomas Gleixner6eda5832009-05-01 18:29:57 +0200236LIB_H += perf.h
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200237LIB_H += util/annotate.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200238LIB_H += util/cache.h
239LIB_H += util/callchain.h
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -0200240LIB_H += util/build-id.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200241LIB_H += util/debug.h
Jiri Olsae90fda02012-01-27 15:34:22 +0100242LIB_H += util/sysfs.h
Jiri Olsacd82a322012-03-15 20:09:17 +0100243LIB_H += util/pmu.h
Arnaldo Carvalho de Meloec218fc2009-10-03 20:30:48 -0300244LIB_H += util/event.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200245LIB_H += util/evsel.h
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200246LIB_H += util/evlist.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200247LIB_H += util/exec_cmd.h
Peter Zijlstra7c6a1c62009-06-25 17:05:54 +0200248LIB_H += util/types.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200249LIB_H += util/levenshtein.h
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300250LIB_H += util/machine.h
Arnaldo Carvalho de Melo4a58e612009-12-27 21:37:00 -0200251LIB_H += util/map.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200252LIB_H += util/parse-options.h
Ingo Molnar8ad8db32009-05-26 11:10:09 +0200253LIB_H += util/parse-events.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200254LIB_H += util/quote.h
255LIB_H += util/util.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200256LIB_H += util/xyarray.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200257LIB_H += util/header.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200258LIB_H += util/help.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200259LIB_H += util/session.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200260LIB_H += util/strbuf.h
Arnaldo Carvalho de Melo25903402009-06-30 19:01:20 -0300261LIB_H += util/strlist.h
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900262LIB_H += util/strfilter.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200263LIB_H += util/svghelper.h
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -0200264LIB_H += util/tool.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200265LIB_H += util/run-command.h
Ingo Molnara930d2c2009-05-27 09:50:13 +0200266LIB_H += util/sigchain.h
Jiri Olsacdd059d2012-10-27 23:18:32 +0200267LIB_H += util/dso.h
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300268LIB_H += util/symbol.h
Ingo Molnar8fc03212009-06-04 15:19:47 +0200269LIB_H += util/color.h
Brice Goglin8d513272009-08-07 13:55:24 +0200270LIB_H += util/values.h
John Kacurdd68ada2009-09-24 18:02:49 +0200271LIB_H += util/sort.h
John Kacur3d1d07e2009-09-28 15:32:55 +0200272LIB_H += util/hist.h
Arnaldo Carvalho de Melo1b46cdd2009-09-28 14:48:46 -0300273LIB_H += util/thread.h
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200274LIB_H += util/thread_map.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200275LIB_H += util/trace-event.h
Masami Hiramatsu57d250d2009-11-30 19:19:34 -0500276LIB_H += util/probe-finder.h
Masami Hiramatsue0d153c2011-06-27 16:27:27 +0900277LIB_H += util/dwarf-aux.h
Masami Hiramatsu50656ee2009-11-30 19:19:58 -0500278LIB_H += util/probe-event.h
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300279LIB_H += util/pstack.h
Paul Mackerrasa12b51c2010-03-10 20:36:09 +1100280LIB_H += util/cpumap.h
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200281LIB_H += util/top.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900282LIB_H += $(ARCH_INCLUDE)
Stephane Eranian023695d2011-02-14 11:20:01 +0200283LIB_H += util/cgroup.h
Robert Richter4e319022013-06-11 17:29:18 +0200284LIB_H += $(LIB_INCLUDE)traceevent/event-parse.h
Namhyung Kim12864b32012-04-26 14:15:22 +0900285LIB_H += util/target.h
David Ahern37bbd3f2012-07-30 22:31:32 -0600286LIB_H += util/rblist.h
David Ahern70b40c42012-07-30 22:31:34 -0600287LIB_H += util/intlist.h
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200288LIB_H += util/perf_regs.h
Jiri Olsa71ad0f52012-08-07 15:20:46 +0200289LIB_H += util/unwind.h
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200290LIB_H += util/vdso.h
Namhyung Kim75291422012-11-15 01:47:40 +0900291LIB_H += ui/helpline.h
292LIB_H += ui/progress.h
293LIB_H += ui/util.h
294LIB_H += ui/ui.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200295
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300296LIB_OBJS += $(OUTPUT)util/abspath.o
297LIB_OBJS += $(OUTPUT)util/alias.o
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200298LIB_OBJS += $(OUTPUT)util/annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300299LIB_OBJS += $(OUTPUT)util/build-id.o
300LIB_OBJS += $(OUTPUT)util/config.o
301LIB_OBJS += $(OUTPUT)util/ctype.o
Jiri Olsae90fda02012-01-27 15:34:22 +0100302LIB_OBJS += $(OUTPUT)util/sysfs.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100303LIB_OBJS += $(OUTPUT)util/pmu.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300304LIB_OBJS += $(OUTPUT)util/environment.o
305LIB_OBJS += $(OUTPUT)util/event.o
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200306LIB_OBJS += $(OUTPUT)util/evlist.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200307LIB_OBJS += $(OUTPUT)util/evsel.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300308LIB_OBJS += $(OUTPUT)util/exec_cmd.o
309LIB_OBJS += $(OUTPUT)util/help.o
310LIB_OBJS += $(OUTPUT)util/levenshtein.o
311LIB_OBJS += $(OUTPUT)util/parse-options.o
312LIB_OBJS += $(OUTPUT)util/parse-events.o
313LIB_OBJS += $(OUTPUT)util/path.o
314LIB_OBJS += $(OUTPUT)util/rbtree.o
315LIB_OBJS += $(OUTPUT)util/bitmap.o
316LIB_OBJS += $(OUTPUT)util/hweight.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300317LIB_OBJS += $(OUTPUT)util/run-command.o
318LIB_OBJS += $(OUTPUT)util/quote.o
319LIB_OBJS += $(OUTPUT)util/strbuf.o
320LIB_OBJS += $(OUTPUT)util/string.o
321LIB_OBJS += $(OUTPUT)util/strlist.o
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900322LIB_OBJS += $(OUTPUT)util/strfilter.o
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200323LIB_OBJS += $(OUTPUT)util/top.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300324LIB_OBJS += $(OUTPUT)util/usage.o
325LIB_OBJS += $(OUTPUT)util/wrapper.o
326LIB_OBJS += $(OUTPUT)util/sigchain.o
Jiri Olsacdd059d2012-10-27 23:18:32 +0200327LIB_OBJS += $(OUTPUT)util/dso.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300328LIB_OBJS += $(OUTPUT)util/symbol.o
Namhyung Kime5a18452012-08-06 13:41:20 +0900329LIB_OBJS += $(OUTPUT)util/symbol-elf.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300330LIB_OBJS += $(OUTPUT)util/color.o
331LIB_OBJS += $(OUTPUT)util/pager.o
332LIB_OBJS += $(OUTPUT)util/header.o
333LIB_OBJS += $(OUTPUT)util/callchain.o
334LIB_OBJS += $(OUTPUT)util/values.o
335LIB_OBJS += $(OUTPUT)util/debug.o
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300336LIB_OBJS += $(OUTPUT)util/machine.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300337LIB_OBJS += $(OUTPUT)util/map.o
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300338LIB_OBJS += $(OUTPUT)util/pstack.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300339LIB_OBJS += $(OUTPUT)util/session.o
340LIB_OBJS += $(OUTPUT)util/thread.o
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200341LIB_OBJS += $(OUTPUT)util/thread_map.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300342LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
Jiri Olsa89812fc2012-03-15 20:09:15 +0100343LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
344LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100345LIB_OBJS += $(OUTPUT)util/pmu-flex.o
346LIB_OBJS += $(OUTPUT)util/pmu-bison.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300347LIB_OBJS += $(OUTPUT)util/trace-event-read.o
348LIB_OBJS += $(OUTPUT)util/trace-event-info.o
349LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
350LIB_OBJS += $(OUTPUT)util/svghelper.o
351LIB_OBJS += $(OUTPUT)util/sort.o
352LIB_OBJS += $(OUTPUT)util/hist.o
353LIB_OBJS += $(OUTPUT)util/probe-event.o
354LIB_OBJS += $(OUTPUT)util/util.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200355LIB_OBJS += $(OUTPUT)util/xyarray.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300356LIB_OBJS += $(OUTPUT)util/cpumap.o
Stephane Eranian023695d2011-02-14 11:20:01 +0200357LIB_OBJS += $(OUTPUT)util/cgroup.o
Namhyung Kim12864b32012-04-26 14:15:22 +0900358LIB_OBJS += $(OUTPUT)util/target.o
David Ahern37bbd3f2012-07-30 22:31:32 -0600359LIB_OBJS += $(OUTPUT)util/rblist.o
David Ahern70b40c42012-07-30 22:31:34 -0600360LIB_OBJS += $(OUTPUT)util/intlist.o
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200361LIB_OBJS += $(OUTPUT)util/vdso.o
Xiao Guangrong0007ece2012-09-17 16:31:14 +0800362LIB_OBJS += $(OUTPUT)util/stat.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900363
Namhyung Kim59ed16b2012-11-13 22:30:35 +0900364LIB_OBJS += $(OUTPUT)ui/setup.o
Namhyung Kime6e90462012-08-16 17:14:50 +0900365LIB_OBJS += $(OUTPUT)ui/helpline.o
Namhyung Kim688f2f52012-11-13 22:30:32 +0900366LIB_OBJS += $(OUTPUT)ui/progress.o
Namhyung Kim75291422012-11-15 01:47:40 +0900367LIB_OBJS += $(OUTPUT)ui/util.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900368LIB_OBJS += $(OUTPUT)ui/hist.o
Namhyung Kim7ccf4f92012-08-20 13:52:05 +0900369LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200370
Irina Tirdea68e94f42012-10-16 02:33:38 +0300371LIB_OBJS += $(OUTPUT)arch/common.o
372
Jiri Olsa945aea22012-10-30 23:01:43 +0100373LIB_OBJS += $(OUTPUT)tests/parse-events.o
374LIB_OBJS += $(OUTPUT)tests/dso-data.o
Jiri Olsa52502bf2012-10-31 15:52:47 +0100375LIB_OBJS += $(OUTPUT)tests/attr.o
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +0100376LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
Jiri Olsad3b59a32012-11-10 01:46:42 +0100377LIB_OBJS += $(OUTPUT)tests/open-syscall.o
Jiri Olsabd90517b2012-11-10 01:46:43 +0100378LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
Jiri Olsadc447ee2012-11-10 01:46:49 +0100379LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
Jiri Olsaa65b9c62012-11-10 01:46:44 +0100380LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
Jiri Olsa16d00fe2012-11-10 01:46:45 +0100381LIB_OBJS += $(OUTPUT)tests/perf-record.o
Jiri Olsabacf7e52012-11-10 01:46:46 +0100382LIB_OBJS += $(OUTPUT)tests/rdpmc.o
Jiri Olsacfffae22012-11-10 01:46:47 +0100383LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
Jiri Olsa5e24a092012-11-10 01:46:48 +0100384LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
Jiri Olsacff7f952012-11-10 01:46:50 +0100385LIB_OBJS += $(OUTPUT)tests/pmu.o
Namhyung Kimf8ebb0c2012-12-10 17:29:57 +0900386LIB_OBJS += $(OUTPUT)tests/hists_link.o
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300387LIB_OBJS += $(OUTPUT)tests/python-use.o
Jiri Olsa5a6bef42013-03-10 19:41:10 +0100388LIB_OBJS += $(OUTPUT)tests/bp_signal.o
Jiri Olsa06933e32013-03-10 19:41:11 +0100389LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
Namhyung Kimd723a552013-03-15 14:58:11 +0900390LIB_OBJS += $(OUTPUT)tests/task-exit.o
Namhyung Kimbc96b362013-03-18 11:41:47 +0900391LIB_OBJS += $(OUTPUT)tests/sw-clock.o
Adrian Hunter3bd5a5f2013-06-28 16:22:19 +0300392ifeq ($(ARCH),x86)
393LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
394endif
Adrian Hunterb55ae0a2013-08-07 14:38:45 +0300395LIB_OBJS += $(OUTPUT)tests/code-reading.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100396
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300397BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300398BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900399# Benchmark modules
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300400BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
401BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900402ifeq ($(RAW_ARCH),x86_64)
403BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200404BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900405endif
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300406BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200407BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900408
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300409BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
Arnaldo Carvalho de Melo43adec92011-03-15 11:04:13 -0300410BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300411BUILTIN_OBJS += $(OUTPUT)builtin-help.o
412BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
413BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
414BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
415BUILTIN_OBJS += $(OUTPUT)builtin-list.o
416BUILTIN_OBJS += $(OUTPUT)builtin-record.o
417BUILTIN_OBJS += $(OUTPUT)builtin-report.o
418BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
419BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
420BUILTIN_OBJS += $(OUTPUT)builtin-top.o
Ingo Molnar133dc4c2010-11-16 18:45:39 +0100421BUILTIN_OBJS += $(OUTPUT)builtin-script.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300422BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
423BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
424BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800425BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
Tom Zanussi454c4072010-05-01 01:41:20 -0500426BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100427BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
Stephane Eranian028f12e2013-01-24 16:10:38 +0100428BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200429
Borislav Petkov85c66be2013-02-20 16:32:30 +0100430PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
Ingo Molnard24e4732009-04-20 13:32:07 +0200431
Ingo Molnard24e4732009-04-20 13:32:07 +0200432# We choose to avoid "if .. else if .. else .. endif endif"
433# because maintaining the nesting to match is a pain. If
434# we had "elif" things would have been much nicer...
435
Ian Munsiecd932c52010-04-20 16:58:32 +1000436-include arch/$(ARCH)/Makefile
437
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300438ifneq ($(OUTPUT),)
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200439 CFLAGS += -I$(OUTPUT)
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300440endif
441
Namhyung Kim393be2e2012-08-06 13:41:21 +0900442ifdef NO_LIBELF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900443EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
444
445# Remove ELF/DWARF dependent codes
446LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
447LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
448LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
449LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
450
451BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
452
453# Use minimal symbol handling
454LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
455
456else # NO_LIBELF
Masami Hiramatsuca721e42010-03-22 13:10:27 -0300457ifndef NO_DWARF
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200458 LIB_OBJS += $(OUTPUT)util/probe-finder.o
459 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
Ian Munsiecd932c52010-04-20 16:58:32 +1000460endif # NO_DWARF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900461endif # NO_LIBELF
Masami Hiramatsu4ea42b12009-10-08 17:17:38 -0400462
Namhyung Kim95485b12012-09-28 18:32:00 +0900463ifndef NO_LIBUNWIND
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200464 LIB_OBJS += $(OUTPUT)util/unwind.o
Jiri Olsa6a40cd92012-08-07 15:20:44 +0200465endif
466
Namhyung Kimf315e162012-09-28 18:32:01 +0900467ifndef NO_LIBAUDIT
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200468 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
Namhyung Kim4d290892012-09-27 20:23:38 +0900469endif
470
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -0300471ifndef NO_SLANG
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200472 LIB_OBJS += $(OUTPUT)ui/browser.o
473 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
474 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
475 LIB_OBJS += $(OUTPUT)ui/browsers/map.o
476 LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
477 LIB_OBJS += $(OUTPUT)ui/tui/setup.o
478 LIB_OBJS += $(OUTPUT)ui/tui/util.o
479 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
480 LIB_OBJS += $(OUTPUT)ui/tui/progress.o
481 LIB_H += ui/browser.h
482 LIB_H += ui/browsers/map.h
483 LIB_H += ui/keysyms.h
484 LIB_H += ui/libslang.h
Jamie Ilescc835752009-12-11 09:21:00 +0000485endif
Tom Zanussi16c632d2009-11-25 01:15:48 -0600486
Namhyung Kimf9f526e2012-09-28 18:32:03 +0900487ifndef NO_GTK2
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200488 LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
489 LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
490 LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
491 LIB_OBJS += $(OUTPUT)ui/gtk/util.o
492 LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
493 LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
494 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
Pekka Enbergc31a9452012-03-19 15:13:29 -0300495endif
496
Jiri Olsa3082cb32013-03-18 00:19:44 +0100497ifndef NO_LIBPERL
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200498 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
499 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
Tom Zanussi16c632d2009-11-25 01:15:48 -0600500endif
501
Jiri Olsa6e533cf2013-03-18 00:35:32 +0100502ifndef NO_LIBPYTHON
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200503 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
504 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600505endif
506
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200507ifeq ($(NO_PERF_REGS),0)
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200508 ifeq ($(ARCH),x86)
509 LIB_H += arch/x86/include/perf_regs.h
510 endif
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200511endif
Kirill A. Shutemovf4e7ac02010-08-21 03:38:20 +0300512
Peter Hurley79d824e2013-01-27 20:51:22 -0500513ifndef NO_LIBNUMA
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200514 BUILTIN_OBJS += $(OUTPUT)bench/numa.o
Peter Hurley79d824e2013-01-27 20:51:22 -0500515endif
516
Ingo Molnard24e4732009-04-20 13:32:07 +0200517ifdef ASCIIDOC8
Jiri Olsa8e1b3f62013-04-15 04:06:58 +0200518 export ASCIIDOC8
Ingo Molnard24e4732009-04-20 13:32:07 +0200519endif
520
Mathias Krause203db292011-06-15 23:03:38 +0200521LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
Ingo Molnard24e4732009-04-20 13:32:07 +0200522
Michael Wittena3d1ee12011-02-02 14:22:08 -0600523export INSTALL SHELL_PATH
Ingo Molnard24e4732009-04-20 13:32:07 +0200524
Ingo Molnard24e4732009-04-20 13:32:07 +0200525### Build rules
526
527SHELL = $(SHELL_PATH)
528
Michael Wittena3d1ee12011-02-02 14:22:08 -0600529all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200530
531please_set_SHELL_PATH_to_a_more_modern_shell:
532 @$$(:)
533
534shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
535
Michael Witten8796cb92011-02-02 11:57:41 -0600536strip: $(PROGRAMS) $(OUTPUT)perf
537 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200538
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300539$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Namhyung Kim3cecaa22013-01-16 20:59:53 +0900540 $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
Ingo Molnar07800602009-04-20 15:00:56 +0200541 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100542 $(CFLAGS) -c $(filter %.c,$^) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200543
Michael Witten8796cb92011-02-02 11:57:41 -0600544$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100545 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
Tom Zanussif2481f32010-08-24 00:23:50 -0500546 $(BUILTIN_OBJS) $(LIBS) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200547
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300548$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100549 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200550 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
551 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
552 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200553
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300554$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100555 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Arjan van de Ven10274982009-09-12 07:53:05 +0200556 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
557 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
558 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
559
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300560$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
Ingo Molnard24e4732009-04-20 13:32:07 +0200561
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300562$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
Mulyadi Santosa1ad05602009-09-26 02:01:41 +0700563 $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200564
Michael Wittena3d1ee12011-02-02 14:22:08 -0600565$(SCRIPTS) : % : %.sh
566 $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
Ingo Molnard24e4732009-04-20 13:32:07 +0200567
Ingo Molnar07800602009-04-20 15:00:56 +0200568# These can record PERF_VERSION
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300569$(OUTPUT)perf.o perf.spec \
Michael Wittena3d1ee12011-02-02 14:22:08 -0600570 $(SCRIPTS) \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300571 : $(OUTPUT)PERF-VERSION-FILE
Ingo Molnard24e4732009-04-20 13:32:07 +0200572
Jiri Olsa89812fc2012-03-15 20:09:15 +0100573.SUFFIXES:
574.SUFFIXES: .o .c .S .s
575
Ingo Molnar65f3e562012-03-29 13:08:38 -0300576# These two need to be here so that when O= is not used they take precedence
577# over the general rule for .o
578
579$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100580 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300581
582$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100583 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300584
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300585$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100586 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000587$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100588 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300589$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100590 $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300591$(OUTPUT)%.o: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100592 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000593$(OUTPUT)%.s: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100594 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200595
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300596$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100597 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200598 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
Ingo Molnard24e4732009-04-20 13:32:07 +0200599 '-DPREFIX="$(prefix_SQ)"' \
600 $<
601
Jiri Olsad898b242012-10-30 23:02:05 +0100602$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100603 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Namhyung Kim000ae332012-12-17 16:25:01 +0900604 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
Jiri Olsad898b242012-10-30 23:02:05 +0100605 $<
606
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300607$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100608 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Jiri Olsa09ecbb02012-12-19 09:52:21 +0100609 -DPYTHONPATH='"$(OUTPUT)python"' \
Namhyung Kim000ae332012-12-17 16:25:01 +0900610 -DPYTHON='"$(PYTHON_WORD)"' \
611 $<
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300612
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300613$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100614 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200615
Namhyung Kimaca7a942012-04-04 00:14:26 -0700616$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100617 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Meloef8f34a2010-08-06 17:35:02 -0300618
Namhyung Kimaca7a942012-04-04 00:14:26 -0700619$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100620 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melo211ef122010-08-10 14:54:09 -0300621
Namhyung Kimaca7a942012-04-04 00:14:26 -0700622$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100623 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melod1b4f242010-08-10 15:49:07 -0300624
Namhyung Kimaca7a942012-04-04 00:14:26 -0700625$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100626 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melob1b02672010-08-10 15:37:34 -0300627
Feng Tang66517822012-10-30 11:56:04 +0800628$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100629 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Feng Tang66517822012-10-30 11:56:04 +0800630
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300631$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100632 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300633
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300634$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100635 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300636
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300637$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
Kirill A. Shutemov575bf1d2013-06-24 11:43:14 +0300638 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<
Tom Zanussi16c632d2009-11-25 01:15:48 -0600639
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300640$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
Kirill A. Shutemov575bf1d2013-06-24 11:43:14 +0300641 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $<
Tom Zanussid1b93772009-11-25 01:15:50 -0600642
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300643$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100644 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600645
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300646$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100647 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600648
Michael Witten8796cb92011-02-02 11:57:41 -0600649$(OUTPUT)perf-%: %.o $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100650 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200651
Ingo Molnard24e4732009-04-20 13:32:07 +0200652$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
Michael Witten8796cb92011-02-02 11:57:41 -0600653$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
Ingo Molnard24e4732009-04-20 13:32:07 +0200654
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300655# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
656# we depend the various files onto their directories.
657DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
Kusanagi Kouichi39cfae62010-09-26 14:17:42 -0300658$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300659# In the second step, we make a rule to actually create these directories
660$(sort $(dir $(DIRECTORY_DEPS))):
661 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
662
Ingo Molnard24e4732009-04-20 13:32:07 +0200663$(LIB_FILE): $(LIB_OBJS)
664 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
665
Namhyung Kim59f3bea2012-05-22 18:03:53 +0900666# libtraceevent.a
667$(LIBTRACEEVENT):
Robert Richter2ede8302012-08-07 19:43:12 +0200668 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a
Steven Rostedtd0e7b852012-04-06 00:47:54 +0200669
David Aherneea9b682012-09-05 18:53:36 -0600670$(LIBTRACEEVENT)-clean:
671 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
672
Borislav Petkov85c66be2013-02-20 16:32:30 +0100673# if subdir is set, we've been called from above so target has been built
674# already
675$(LIBLK):
676ifeq ($(subdir),)
677 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a
678endif
679
680$(LIBLK)-clean:
681ifeq ($(subdir),)
682 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
683endif
684
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800685help:
686 @echo 'Perf make targets:'
687 @echo ' doc - make *all* documentation (see below)'
688 @echo ' man - make manpage documentation (access with man <foo>)'
689 @echo ' html - make html documentation'
690 @echo ' info - make GNU info documentation (access with info <foo>)'
691 @echo ' pdf - make pdf documentation'
692 @echo ' TAGS - use etags to make tag information for source browsing'
693 @echo ' tags - use ctags to make tag information for source browsing'
694 @echo ' cscope - use cscope to make interactive browsing database'
695 @echo ''
696 @echo 'Perf install targets:'
697 @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed'
698 @echo ' HINT: use "make prefix=<path> <install target>" to install to a particular'
699 @echo ' path like make prefix=/usr/local install install-doc'
700 @echo ' install - install compiled binaries'
701 @echo ' install-doc - install *all* documentation'
702 @echo ' install-man - install manpage documentation'
703 @echo ' install-html - install html documentation'
704 @echo ' install-info - install GNU info documentation'
705 @echo ' install-pdf - install pdf documentation'
706 @echo ''
707 @echo ' quick-install-doc - alias for quick-install-man'
708 @echo ' quick-install-man - install the documentation quickly'
709 @echo ' quick-install-html - install the html documentation quickly'
710 @echo ''
711 @echo 'Perf maintainer targets:'
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800712 @echo ' clean - clean all binary objects and build output'
713
Ingo Molnarc1c23652009-05-30 12:38:51 +0200714
Namhyung Kim536e2b02012-10-26 17:55:49 +0900715DOC_TARGETS := doc man html info pdf
Ingo Molnarc1c23652009-05-30 12:38:51 +0200716
Namhyung Kim536e2b02012-10-26 17:55:49 +0900717INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
718INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
Ingo Molnarc1c23652009-05-30 12:38:51 +0200719
Namhyung Kim536e2b02012-10-26 17:55:49 +0900720# 'make doc' should call 'make -C Documentation all'
721$(DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900722 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200723
Ingo Molnard24e4732009-04-20 13:32:07 +0200724TAGS:
725 $(RM) TAGS
726 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
727
728tags:
729 $(RM) tags
730 $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
731
732cscope:
733 $(RM) cscope*
734 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
735
736### Detect prefix changes
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100737TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
Ingo Molnar07800602009-04-20 15:00:56 +0200738 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
Ingo Molnard24e4732009-04-20 13:32:07 +0200739
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300740$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
Ingo Molnard24e4732009-04-20 13:32:07 +0200741 @FLAGS='$(TRACK_CFLAGS)'; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300742 if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
Ingo Molnard24e4732009-04-20 13:32:07 +0200743 echo 1>&2 " * new build flags or prefix"; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300744 echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200745 fi
746
Ingo Molnard24e4732009-04-20 13:32:07 +0200747### Testing rules
748
Ingo Molnard24e4732009-04-20 13:32:07 +0200749# GNU make supports exporting all variables by "export" without parameters.
750# However, the environment gets quite big, and some programs have problems
751# with that.
752
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300753check: $(OUTPUT)common-cmds.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200754 if sparse; \
755 then \
Ingo Molnar148be2c2009-04-27 08:02:14 +0200756 for i in *.c */*.c; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200757 do \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100758 sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200759 done; \
760 else \
Ingo Molnard24e4732009-04-20 13:32:07 +0200761 exit 1; \
762 fi
763
Ingo Molnard24e4732009-04-20 13:32:07 +0200764### Installation rules
765
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300766install-bin: all
Ingo Molnard24e4732009-04-20 13:32:07 +0200767 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
Michael Witten8796cb92011-02-02 11:57:41 -0600768 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600769 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
770 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300771 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600772 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
773 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
774 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600775 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
Tom Zanussi4d161f02010-01-27 02:27:58 -0600776 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600777 $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
Tom Zanussi4d161f02010-01-27 02:27:58 -0600778 $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
779 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Namhyung Kimb25085b2012-08-09 16:31:53 +0200780 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
781 $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
Jiri Olsad898b242012-10-30 23:02:05 +0100782 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
783 $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
784 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
785 $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
Tom Zanussi82d156c2010-01-27 02:27:55 -0600786
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300787install: install-bin try-install-man
788
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200789install-python_ext:
790 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
791
Namhyung Kim536e2b02012-10-26 17:55:49 +0900792# 'make install-doc' should call 'make -C Documentation install'
793$(INSTALL_DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900794 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200795
Ingo Molnard24e4732009-04-20 13:32:07 +0200796### Cleaning rules
797
Borislav Petkov85c66be2013-02-20 16:32:30 +0100798clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean
Kusanagi Kouichi8b7e0b32011-08-07 17:39:31 +0900799 $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
Michael Wittena3d1ee12011-02-02 14:22:08 -0600800 $(RM) $(ALL_PROGRAMS) perf
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300801 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
Namhyung Kim615d7742012-10-26 17:55:50 +0900802 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
Michael Wittena3d1ee12011-02-02 14:22:08 -0600803 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
Palmer Cox7f309ed2012-07-29 17:54:43 -0400804 $(RM) $(OUTPUT)util/*-bison*
805 $(RM) $(OUTPUT)util/*-flex*
Michael Wittenced465c2011-04-02 21:46:09 +0000806 $(python-clean)
Ingo Molnard24e4732009-04-20 13:32:07 +0200807
Borislav Petkov85c66be2013-02-20 16:32:30 +0100808.PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK)
Ingo Molnard24e4732009-04-20 13:32:07 +0200809.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
Ingo Molnar07800602009-04-20 15:00:56 +0200810.PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS