blob: 4275ddc5afba1db40c8da1e8783087a227530e14 [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
Ingo Molnare0143ba2009-03-23 21:29:59 +010054
Jiri Olsa362493f2013-03-25 00:40:48 +010055ifeq ($(srctree),)
56srctree := $(patsubst %/,%,$(dir $(shell pwd)))
57srctree := $(patsubst %/,%,$(dir $(srctree)))
58#$(info Determined 'srctree' to be $(srctree))
59endif
60
61ifneq ($(objtree),)
62#$(info Determined 'objtree' to be $(objtree))
63endif
64
65ifneq ($(OUTPUT),)
66#$(info Determined 'OUTPUT' to be $(OUTPUT))
67endif
68
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -030069$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
70 @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
Ingo Molnare0143ba2009-03-23 21:29:59 +010071
Lin Ming174a7b1f2011-05-07 12:41:14 +080072CC = $(CROSS_COMPILE)gcc
73AR = $(CROSS_COMPILE)ar
74
Jiri Olsaa32f4932013-03-25 00:32:01 +010075RM = rm -f
76MKDIR = mkdir
77FIND = find
78INSTALL = install
79FLEX = flex
80BISON = bison
81STRIP ?= strip
82
Jiri Olsa7c537462013-05-24 14:35:23 +020083LK_DIR = $(srctree)/tools/lib/lk/
84TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
Jiri Olsa362493f2013-03-25 00:40:48 +010085
Jiri Olsa8bd407b2013-03-15 16:28:49 +010086# include config/Makefile by default and rule out
87# non-config cases
88config := 1
89
90NON_CONFIG_TARGETS := clean TAGS tags cscope help
91
92ifdef MAKECMDGOALS
93ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
94 config := 0
Ian Munsiecd932c52010-04-20 16:58:32 +100095endif
Jiri Olsa8bd407b2013-03-15 16:28:49 +010096endif
97
98ifeq ($(config),1)
99include config/Makefile
Ian Munsiecd932c52010-04-20 16:58:32 +1000100endif
101
Ingo Molnard24e4732009-04-20 13:32:07 +0200102export prefix bindir sharedir sysconfdir
103
Ingo Molnard24e4732009-04-20 13:32:07 +0200104# sparse is architecture-neutral, which means that we need to tell it
105# explicitly what architecture to check for. Fix this up for yours..
106SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
107
Ingo Molnard24e4732009-04-20 13:32:07 +0200108# Guard against environment variables
109BUILTIN_OBJS =
Ingo Molnard24e4732009-04-20 13:32:07 +0200110LIB_H =
111LIB_OBJS =
Arnaldo Carvalho de Melo877108e2011-01-29 15:44:29 -0200112PYRF_OBJS =
Ingo Molnard24e4732009-04-20 13:32:07 +0200113SCRIPT_SH =
Ingo Molnard24e4732009-04-20 13:32:07 +0200114
Arnaldo Carvalho de Melo2c585172010-01-15 13:17:52 -0200115SCRIPT_SH += perf-archive.sh
Ingo Molnar07800602009-04-20 15:00:56 +0200116
Tom Zanussif2481f32010-08-24 00:23:50 -0500117grep-libs = $(filter -l%,$(1))
118strip-libs = $(filter-out -l%,$(1))
119
Borislav Petkov85c66be2013-02-20 16:32:30 +0100120LK_PATH=$(LK_DIR)
121
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300122ifneq ($(OUTPUT),)
123 TE_PATH=$(OUTPUT)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100124ifneq ($(subdir),)
125 LK_PATH=$(OUTPUT)$(LK_DIR)
126else
127 LK_PATH=$(OUTPUT)
128endif
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300129else
130 TE_PATH=$(TRACE_EVENT_DIR)
131endif
132
133LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900134export LIBTRACEEVENT
135
Borislav Petkov85c66be2013-02-20 16:32:30 +0100136LIBLK = $(LK_PATH)liblk.a
137export LIBLK
138
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900139# python extension build directories
140PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
141PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
142PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
143export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
144
145python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
146
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900147PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
Naohiro Aota707ef2e2013-03-24 22:37:54 +0900148PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT)
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900149
Namhyung Kime4898332012-09-28 18:31:58 +0900150$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100151 $(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200152 --quiet build_ext; \
153 mkdir -p $(OUTPUT)python && \
154 cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
Ingo Molnar07800602009-04-20 15:00:56 +0200155#
156# No Perl scripts right now:
157#
158
Michael Witten0a54fb62011-02-02 12:04:27 -0600159SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
Ingo Molnard24e4732009-04-20 13:32:07 +0200160
Ingo Molnar07800602009-04-20 15:00:56 +0200161#
Ingo Molnar125e7022009-04-20 16:13:46 +0200162# Single 'perf' binary right now:
Ingo Molnar07800602009-04-20 15:00:56 +0200163#
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300164PROGRAMS += $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200165
Ingo Molnar07800602009-04-20 15:00:56 +0200166# what 'all' will build and 'install' will install, in perfexecdir
Arnaldo Carvalho de Melo978f6262011-02-01 16:40:51 -0200167ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200168
Ingo Molnar07800602009-04-20 15:00:56 +0200169# what 'all' will build but not install in perfexecdir
Michael Witten8796cb92011-02-02 11:57:41 -0600170OTHER_PROGRAMS = $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200171
172# Set paths to tools early so that they can be used for version tests.
173ifndef SHELL_PATH
174 SHELL_PATH = /bin/sh
175endif
176ifndef PERL_PATH
177 PERL_PATH = /usr/bin/perl
178endif
179
180export PERL_PATH
181
Eric Sandeene6048fb2012-09-20 21:31:44 -0500182$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
Jiri Olsa82ba1f22012-05-21 09:12:50 +0200183 $(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 -0300184
Jiri Olsa024e6c92012-04-11 12:39:51 +0200185$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800186 $(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 -0300187
Eric Sandeene6048fb2012-09-20 21:31:44 -0500188$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300189 $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
190
Jiri Olsa024e6c92012-04-11 12:39:51 +0200191$(OUTPUT)util/pmu-bison.c: util/pmu.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800192 $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
Ingo Molnar65f3e562012-03-29 13:08:38 -0300193
Jiri Olsa024e6c92012-04-11 12:39:51 +0200194$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
195$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300196
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300197LIB_FILE=$(OUTPUT)libperf.a
Ingo Molnard24e4732009-04-20 13:32:07 +0200198
Ingo Molnar7d380c82012-10-14 10:40:57 +0200199LIB_H += ../../include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300200LIB_H += ../../include/linux/rbtree.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300201LIB_H += ../../include/linux/list.h
Ingo Molnar7d380c82012-10-14 10:40:57 +0200202LIB_H += ../../include/uapi/linux/const.h
Hitoshi Mitake18e97e02010-01-30 20:43:24 +0900203LIB_H += ../../include/linux/hash.h
Masami Hiramatsu97698332009-10-16 20:08:18 -0400204LIB_H += ../../include/linux/stringify.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200205LIB_H += util/include/linux/bitmap.h
206LIB_H += util/include/linux/bitops.h
207LIB_H += util/include/linux/compiler.h
Arnaldo Carvalho de Melo75911c92011-05-26 10:13:38 -0300208LIB_H += util/include/linux/const.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200209LIB_H += util/include/linux/ctype.h
210LIB_H += util/include/linux/kernel.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300211LIB_H += util/include/linux/list.h
Jiri Olsa2c86bf12012-03-26 11:17:05 +0200212LIB_H += util/include/linux/export.h
Irina Tirdeaf8fcd772012-09-11 01:14:58 +0300213LIB_H += util/include/linux/magic.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200214LIB_H += util/include/linux/poison.h
215LIB_H += util/include/linux/prefetch.h
216LIB_H += util/include/linux/rbtree.h
Markus Trippelsdorf871a0592012-10-09 20:01:56 +0200217LIB_H += util/include/linux/rbtree_augmented.h
Arnaldo Carvalho de Melo20639c12009-10-19 15:11:36 -0200218LIB_H += util/include/linux/string.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200219LIB_H += util/include/linux/types.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900220LIB_H += util/include/linux/linkage.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200221LIB_H += util/include/asm/asm-offsets.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200222LIB_H += util/include/asm/bug.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200223LIB_H += util/include/asm/byteorder.h
Arnaldo Carvalho de Melofb720142010-04-30 19:31:12 -0300224LIB_H += util/include/asm/hweight.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200225LIB_H += util/include/asm/swab.h
226LIB_H += util/include/asm/system.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200227LIB_H += util/include/asm/uaccess.h
Ian Munsiecd932c52010-04-20 16:58:32 +1000228LIB_H += util/include/dwarf-regs.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900229LIB_H += util/include/asm/dwarf2.h
230LIB_H += util/include/asm/cpufeature.h
Ingo Molnareae7a752012-03-14 12:42:34 -0300231LIB_H += util/include/asm/unistd_32.h
232LIB_H += util/include/asm/unistd_64.h
Thomas Gleixner6eda5832009-05-01 18:29:57 +0200233LIB_H += perf.h
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200234LIB_H += util/annotate.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200235LIB_H += util/cache.h
236LIB_H += util/callchain.h
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -0200237LIB_H += util/build-id.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200238LIB_H += util/debug.h
Jiri Olsae90fda02012-01-27 15:34:22 +0100239LIB_H += util/sysfs.h
Jiri Olsacd82a322012-03-15 20:09:17 +0100240LIB_H += util/pmu.h
Arnaldo Carvalho de Meloec218fc2009-10-03 20:30:48 -0300241LIB_H += util/event.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200242LIB_H += util/evsel.h
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200243LIB_H += util/evlist.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200244LIB_H += util/exec_cmd.h
Peter Zijlstra7c6a1c62009-06-25 17:05:54 +0200245LIB_H += util/types.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200246LIB_H += util/levenshtein.h
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300247LIB_H += util/machine.h
Arnaldo Carvalho de Melo4a58e612009-12-27 21:37:00 -0200248LIB_H += util/map.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200249LIB_H += util/parse-options.h
Ingo Molnar8ad8db32009-05-26 11:10:09 +0200250LIB_H += util/parse-events.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200251LIB_H += util/quote.h
252LIB_H += util/util.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200253LIB_H += util/xyarray.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200254LIB_H += util/header.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200255LIB_H += util/help.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200256LIB_H += util/session.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200257LIB_H += util/strbuf.h
Arnaldo Carvalho de Melo25903402009-06-30 19:01:20 -0300258LIB_H += util/strlist.h
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900259LIB_H += util/strfilter.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200260LIB_H += util/svghelper.h
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -0200261LIB_H += util/tool.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200262LIB_H += util/run-command.h
Ingo Molnara930d2c2009-05-27 09:50:13 +0200263LIB_H += util/sigchain.h
Jiri Olsacdd059d2012-10-27 23:18:32 +0200264LIB_H += util/dso.h
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300265LIB_H += util/symbol.h
Ingo Molnar8fc03212009-06-04 15:19:47 +0200266LIB_H += util/color.h
Brice Goglin8d513272009-08-07 13:55:24 +0200267LIB_H += util/values.h
John Kacurdd68ada2009-09-24 18:02:49 +0200268LIB_H += util/sort.h
John Kacur3d1d07e2009-09-28 15:32:55 +0200269LIB_H += util/hist.h
Arnaldo Carvalho de Melo1b46cdd2009-09-28 14:48:46 -0300270LIB_H += util/thread.h
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200271LIB_H += util/thread_map.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200272LIB_H += util/trace-event.h
Masami Hiramatsu57d250d2009-11-30 19:19:34 -0500273LIB_H += util/probe-finder.h
Masami Hiramatsue0d153c2011-06-27 16:27:27 +0900274LIB_H += util/dwarf-aux.h
Masami Hiramatsu50656ee2009-11-30 19:19:58 -0500275LIB_H += util/probe-event.h
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300276LIB_H += util/pstack.h
Paul Mackerrasa12b51c2010-03-10 20:36:09 +1100277LIB_H += util/cpumap.h
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200278LIB_H += util/top.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900279LIB_H += $(ARCH_INCLUDE)
Stephane Eranian023695d2011-02-14 11:20:01 +0200280LIB_H += util/cgroup.h
Namhyung Kim59f3bea2012-05-22 18:03:53 +0900281LIB_H += $(TRACE_EVENT_DIR)event-parse.h
Namhyung Kim12864b32012-04-26 14:15:22 +0900282LIB_H += util/target.h
David Ahern37bbd3f2012-07-30 22:31:32 -0600283LIB_H += util/rblist.h
David Ahern70b40c42012-07-30 22:31:34 -0600284LIB_H += util/intlist.h
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200285LIB_H += util/perf_regs.h
Jiri Olsa71ad0f52012-08-07 15:20:46 +0200286LIB_H += util/unwind.h
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200287LIB_H += util/vdso.h
Namhyung Kim75291422012-11-15 01:47:40 +0900288LIB_H += ui/helpline.h
289LIB_H += ui/progress.h
290LIB_H += ui/util.h
291LIB_H += ui/ui.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200292
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300293LIB_OBJS += $(OUTPUT)util/abspath.o
294LIB_OBJS += $(OUTPUT)util/alias.o
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200295LIB_OBJS += $(OUTPUT)util/annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300296LIB_OBJS += $(OUTPUT)util/build-id.o
297LIB_OBJS += $(OUTPUT)util/config.o
298LIB_OBJS += $(OUTPUT)util/ctype.o
Jiri Olsae90fda02012-01-27 15:34:22 +0100299LIB_OBJS += $(OUTPUT)util/sysfs.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100300LIB_OBJS += $(OUTPUT)util/pmu.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300301LIB_OBJS += $(OUTPUT)util/environment.o
302LIB_OBJS += $(OUTPUT)util/event.o
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200303LIB_OBJS += $(OUTPUT)util/evlist.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200304LIB_OBJS += $(OUTPUT)util/evsel.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300305LIB_OBJS += $(OUTPUT)util/exec_cmd.o
306LIB_OBJS += $(OUTPUT)util/help.o
307LIB_OBJS += $(OUTPUT)util/levenshtein.o
308LIB_OBJS += $(OUTPUT)util/parse-options.o
309LIB_OBJS += $(OUTPUT)util/parse-events.o
310LIB_OBJS += $(OUTPUT)util/path.o
311LIB_OBJS += $(OUTPUT)util/rbtree.o
312LIB_OBJS += $(OUTPUT)util/bitmap.o
313LIB_OBJS += $(OUTPUT)util/hweight.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300314LIB_OBJS += $(OUTPUT)util/run-command.o
315LIB_OBJS += $(OUTPUT)util/quote.o
316LIB_OBJS += $(OUTPUT)util/strbuf.o
317LIB_OBJS += $(OUTPUT)util/string.o
318LIB_OBJS += $(OUTPUT)util/strlist.o
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900319LIB_OBJS += $(OUTPUT)util/strfilter.o
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200320LIB_OBJS += $(OUTPUT)util/top.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300321LIB_OBJS += $(OUTPUT)util/usage.o
322LIB_OBJS += $(OUTPUT)util/wrapper.o
323LIB_OBJS += $(OUTPUT)util/sigchain.o
Jiri Olsacdd059d2012-10-27 23:18:32 +0200324LIB_OBJS += $(OUTPUT)util/dso.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300325LIB_OBJS += $(OUTPUT)util/symbol.o
Namhyung Kime5a18452012-08-06 13:41:20 +0900326LIB_OBJS += $(OUTPUT)util/symbol-elf.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300327LIB_OBJS += $(OUTPUT)util/color.o
328LIB_OBJS += $(OUTPUT)util/pager.o
329LIB_OBJS += $(OUTPUT)util/header.o
330LIB_OBJS += $(OUTPUT)util/callchain.o
331LIB_OBJS += $(OUTPUT)util/values.o
332LIB_OBJS += $(OUTPUT)util/debug.o
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300333LIB_OBJS += $(OUTPUT)util/machine.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300334LIB_OBJS += $(OUTPUT)util/map.o
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300335LIB_OBJS += $(OUTPUT)util/pstack.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300336LIB_OBJS += $(OUTPUT)util/session.o
337LIB_OBJS += $(OUTPUT)util/thread.o
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200338LIB_OBJS += $(OUTPUT)util/thread_map.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300339LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
Jiri Olsa89812fc2012-03-15 20:09:15 +0100340LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
341LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100342LIB_OBJS += $(OUTPUT)util/pmu-flex.o
343LIB_OBJS += $(OUTPUT)util/pmu-bison.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300344LIB_OBJS += $(OUTPUT)util/trace-event-read.o
345LIB_OBJS += $(OUTPUT)util/trace-event-info.o
346LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
347LIB_OBJS += $(OUTPUT)util/svghelper.o
348LIB_OBJS += $(OUTPUT)util/sort.o
349LIB_OBJS += $(OUTPUT)util/hist.o
350LIB_OBJS += $(OUTPUT)util/probe-event.o
351LIB_OBJS += $(OUTPUT)util/util.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200352LIB_OBJS += $(OUTPUT)util/xyarray.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300353LIB_OBJS += $(OUTPUT)util/cpumap.o
Stephane Eranian023695d2011-02-14 11:20:01 +0200354LIB_OBJS += $(OUTPUT)util/cgroup.o
Namhyung Kim12864b32012-04-26 14:15:22 +0900355LIB_OBJS += $(OUTPUT)util/target.o
David Ahern37bbd3f2012-07-30 22:31:32 -0600356LIB_OBJS += $(OUTPUT)util/rblist.o
David Ahern70b40c42012-07-30 22:31:34 -0600357LIB_OBJS += $(OUTPUT)util/intlist.o
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200358LIB_OBJS += $(OUTPUT)util/vdso.o
Xiao Guangrong0007ece2012-09-17 16:31:14 +0800359LIB_OBJS += $(OUTPUT)util/stat.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900360
Namhyung Kim59ed16b2012-11-13 22:30:35 +0900361LIB_OBJS += $(OUTPUT)ui/setup.o
Namhyung Kime6e90462012-08-16 17:14:50 +0900362LIB_OBJS += $(OUTPUT)ui/helpline.o
Namhyung Kim688f2f52012-11-13 22:30:32 +0900363LIB_OBJS += $(OUTPUT)ui/progress.o
Namhyung Kim75291422012-11-15 01:47:40 +0900364LIB_OBJS += $(OUTPUT)ui/util.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900365LIB_OBJS += $(OUTPUT)ui/hist.o
Namhyung Kim7ccf4f92012-08-20 13:52:05 +0900366LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200367
Irina Tirdea68e94f42012-10-16 02:33:38 +0300368LIB_OBJS += $(OUTPUT)arch/common.o
369
Jiri Olsa945aea22012-10-30 23:01:43 +0100370LIB_OBJS += $(OUTPUT)tests/parse-events.o
371LIB_OBJS += $(OUTPUT)tests/dso-data.o
Jiri Olsa52502bf2012-10-31 15:52:47 +0100372LIB_OBJS += $(OUTPUT)tests/attr.o
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +0100373LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
Jiri Olsad3b59a32012-11-10 01:46:42 +0100374LIB_OBJS += $(OUTPUT)tests/open-syscall.o
Jiri Olsabd905172012-11-10 01:46:43 +0100375LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
Jiri Olsadc447ee2012-11-10 01:46:49 +0100376LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
Jiri Olsaa65b9c62012-11-10 01:46:44 +0100377LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
Jiri Olsa16d00fe2012-11-10 01:46:45 +0100378LIB_OBJS += $(OUTPUT)tests/perf-record.o
Jiri Olsabacf7e52012-11-10 01:46:46 +0100379LIB_OBJS += $(OUTPUT)tests/rdpmc.o
Jiri Olsacfffae22012-11-10 01:46:47 +0100380LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
Jiri Olsa5e24a092012-11-10 01:46:48 +0100381LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
Jiri Olsacff7f952012-11-10 01:46:50 +0100382LIB_OBJS += $(OUTPUT)tests/pmu.o
Namhyung Kimf8ebb0c2012-12-10 17:29:57 +0900383LIB_OBJS += $(OUTPUT)tests/hists_link.o
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300384LIB_OBJS += $(OUTPUT)tests/python-use.o
Jiri Olsa5a6bef42013-03-10 19:41:10 +0100385LIB_OBJS += $(OUTPUT)tests/bp_signal.o
Jiri Olsa06933e32013-03-10 19:41:11 +0100386LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
Namhyung Kimd723a552013-03-15 14:58:11 +0900387LIB_OBJS += $(OUTPUT)tests/task-exit.o
Namhyung Kimbc96b362013-03-18 11:41:47 +0900388LIB_OBJS += $(OUTPUT)tests/sw-clock.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100389
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300390BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300391BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900392# Benchmark modules
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300393BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
394BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900395ifeq ($(RAW_ARCH),x86_64)
396BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200397BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900398endif
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300399BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200400BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900401
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300402BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
Arnaldo Carvalho de Melo43adec92011-03-15 11:04:13 -0300403BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300404BUILTIN_OBJS += $(OUTPUT)builtin-help.o
405BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
406BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
407BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
408BUILTIN_OBJS += $(OUTPUT)builtin-list.o
409BUILTIN_OBJS += $(OUTPUT)builtin-record.o
410BUILTIN_OBJS += $(OUTPUT)builtin-report.o
411BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
412BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
413BUILTIN_OBJS += $(OUTPUT)builtin-top.o
Ingo Molnar133dc4c2010-11-16 18:45:39 +0100414BUILTIN_OBJS += $(OUTPUT)builtin-script.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300415BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
416BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
417BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800418BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
Tom Zanussi454c4072010-05-01 01:41:20 -0500419BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100420BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
Stephane Eranian028f12e2013-01-24 16:10:38 +0100421BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200422
Borislav Petkov85c66be2013-02-20 16:32:30 +0100423PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
Ingo Molnard24e4732009-04-20 13:32:07 +0200424
Ingo Molnard24e4732009-04-20 13:32:07 +0200425# We choose to avoid "if .. else if .. else .. endif endif"
426# because maintaining the nesting to match is a pain. If
427# we had "elif" things would have been much nicer...
428
Ian Munsiecd932c52010-04-20 16:58:32 +1000429-include arch/$(ARCH)/Makefile
430
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300431ifneq ($(OUTPUT),)
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100432 CFLAGS += -I$(OUTPUT)
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300433endif
434
Namhyung Kim393be2e2012-08-06 13:41:21 +0900435ifdef NO_LIBELF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900436EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
437
438# Remove ELF/DWARF dependent codes
439LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
440LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
441LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
442LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
443
444BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
445
446# Use minimal symbol handling
447LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
448
449else # NO_LIBELF
Masami Hiramatsuca721e42010-03-22 13:10:27 -0300450ifndef NO_DWARF
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300451 LIB_OBJS += $(OUTPUT)util/probe-finder.o
Masami Hiramatsue0d153c2011-06-27 16:27:27 +0900452 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
Ian Munsiecd932c52010-04-20 16:58:32 +1000453endif # NO_DWARF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900454endif # NO_LIBELF
Masami Hiramatsu4ea42b12009-10-08 17:17:38 -0400455
Namhyung Kim95485b12012-09-28 18:32:00 +0900456ifndef NO_LIBUNWIND
Jiri Olsa71ad0f52012-08-07 15:20:46 +0200457 LIB_OBJS += $(OUTPUT)util/unwind.o
Jiri Olsa6a40cd92012-08-07 15:20:44 +0200458endif
459
Namhyung Kimf315e162012-09-28 18:32:01 +0900460ifndef NO_LIBAUDIT
Jiri Olsaa8279522013-03-25 00:54:36 +0100461 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
Namhyung Kim4d290892012-09-27 20:23:38 +0900462endif
463
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -0300464ifndef NO_SLANG
Jiri Olsa4a8f8882013-03-25 00:56:08 +0100465 LIB_OBJS += $(OUTPUT)ui/browser.o
466 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
467 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
468 LIB_OBJS += $(OUTPUT)ui/browsers/map.o
469 LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
470 LIB_OBJS += $(OUTPUT)ui/tui/setup.o
471 LIB_OBJS += $(OUTPUT)ui/tui/util.o
472 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
473 LIB_OBJS += $(OUTPUT)ui/tui/progress.o
474 LIB_H += ui/browser.h
475 LIB_H += ui/browsers/map.h
476 LIB_H += ui/keysyms.h
477 LIB_H += ui/libslang.h
Jamie Ilescc835752009-12-11 09:21:00 +0000478endif
Tom Zanussi16c632d2009-11-25 01:15:48 -0600479
Namhyung Kimf9f526e2012-09-28 18:32:03 +0900480ifndef NO_GTK2
Jiri Olsa58cabf62013-03-18 00:09:24 +0100481 LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
482 LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
483 LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
484 LIB_OBJS += $(OUTPUT)ui/gtk/util.o
485 LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
486 LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
487 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
Pekka Enbergc31a9452012-03-19 15:13:29 -0300488endif
489
Jiri Olsa3082cb32013-03-18 00:19:44 +0100490ifndef NO_LIBPERL
491 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
492 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
Tom Zanussi16c632d2009-11-25 01:15:48 -0600493endif
494
Jiri Olsa6e533cf2013-03-18 00:35:32 +0100495ifndef NO_LIBPYTHON
496 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
497 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600498endif
499
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200500ifeq ($(NO_PERF_REGS),0)
501 ifeq ($(ARCH),x86)
502 LIB_H += arch/x86/include/perf_regs.h
503 endif
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200504endif
Kirill A. Shutemovf4e7ac02010-08-21 03:38:20 +0300505
Peter Hurley79d824e2013-01-27 20:51:22 -0500506ifndef NO_LIBNUMA
Jiri Olsa58a0abd2013-03-18 00:45:27 +0100507 BUILTIN_OBJS += $(OUTPUT)bench/numa.o
Peter Hurley79d824e2013-01-27 20:51:22 -0500508endif
509
Ingo Molnard24e4732009-04-20 13:32:07 +0200510ifdef ASCIIDOC8
511 export ASCIIDOC8
512endif
513
Mathias Krause203db292011-06-15 23:03:38 +0200514LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
Ingo Molnard24e4732009-04-20 13:32:07 +0200515
Michael Wittena3d1ee12011-02-02 14:22:08 -0600516export INSTALL SHELL_PATH
Ingo Molnard24e4732009-04-20 13:32:07 +0200517
Ingo Molnard24e4732009-04-20 13:32:07 +0200518### Build rules
519
520SHELL = $(SHELL_PATH)
521
Michael Wittena3d1ee12011-02-02 14:22:08 -0600522all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200523
524please_set_SHELL_PATH_to_a_more_modern_shell:
525 @$$(:)
526
527shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
528
Michael Witten8796cb92011-02-02 11:57:41 -0600529strip: $(PROGRAMS) $(OUTPUT)perf
530 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200531
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300532$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Namhyung Kim3cecaa22013-01-16 20:59:53 +0900533 $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
Ingo Molnar07800602009-04-20 15:00:56 +0200534 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100535 $(CFLAGS) -c $(filter %.c,$^) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200536
Michael Witten8796cb92011-02-02 11:57:41 -0600537$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100538 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
Tom Zanussif2481f32010-08-24 00:23:50 -0500539 $(BUILTIN_OBJS) $(LIBS) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200540
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300541$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100542 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200543 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
544 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
545 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200546
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300547$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100548 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Arjan van de Ven10274982009-09-12 07:53:05 +0200549 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
550 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
551 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
552
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300553$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
Ingo Molnard24e4732009-04-20 13:32:07 +0200554
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300555$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
Mulyadi Santosa1ad05602009-09-26 02:01:41 +0700556 $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200557
Michael Wittena3d1ee12011-02-02 14:22:08 -0600558$(SCRIPTS) : % : %.sh
559 $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
Ingo Molnard24e4732009-04-20 13:32:07 +0200560
Ingo Molnar07800602009-04-20 15:00:56 +0200561# These can record PERF_VERSION
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300562$(OUTPUT)perf.o perf.spec \
Michael Wittena3d1ee12011-02-02 14:22:08 -0600563 $(SCRIPTS) \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300564 : $(OUTPUT)PERF-VERSION-FILE
Ingo Molnard24e4732009-04-20 13:32:07 +0200565
Jiri Olsa89812fc2012-03-15 20:09:15 +0100566.SUFFIXES:
567.SUFFIXES: .o .c .S .s
568
Ingo Molnar65f3e562012-03-29 13:08:38 -0300569# These two need to be here so that when O= is not used they take precedence
570# over the general rule for .o
571
572$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100573 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300574
575$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100576 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300577
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300578$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100579 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000580$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100581 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300582$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100583 $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300584$(OUTPUT)%.o: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100585 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000586$(OUTPUT)%.s: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100587 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200588
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300589$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100590 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200591 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
Ingo Molnard24e4732009-04-20 13:32:07 +0200592 '-DPREFIX="$(prefix_SQ)"' \
593 $<
594
Jiri Olsad898b242012-10-30 23:02:05 +0100595$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100596 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Namhyung Kim000ae332012-12-17 16:25:01 +0900597 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
Jiri Olsad898b242012-10-30 23:02:05 +0100598 $<
599
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300600$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100601 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Jiri Olsa09ecbb02012-12-19 09:52:21 +0100602 -DPYTHONPATH='"$(OUTPUT)python"' \
Namhyung Kim000ae332012-12-17 16:25:01 +0900603 -DPYTHON='"$(PYTHON_WORD)"' \
604 $<
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300605
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300606$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100607 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200608
Namhyung Kimaca7a942012-04-04 00:14:26 -0700609$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100610 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Meloef8f34a2010-08-06 17:35:02 -0300611
Namhyung Kimaca7a942012-04-04 00:14:26 -0700612$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100613 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melo211ef122010-08-10 14:54:09 -0300614
Namhyung Kimaca7a942012-04-04 00:14:26 -0700615$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100616 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melod1b4f242010-08-10 15:49:07 -0300617
Namhyung Kimaca7a942012-04-04 00:14:26 -0700618$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100619 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melob1b02672010-08-10 15:37:34 -0300620
Feng Tang66517822012-10-30 11:56:04 +0800621$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100622 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Feng Tang66517822012-10-30 11:56:04 +0800623
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300624$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100625 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300626
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300627$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100628 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300629
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300630$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100631 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
Tom Zanussi16c632d2009-11-25 01:15:48 -0600632
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300633$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100634 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
Tom Zanussid1b93772009-11-25 01:15:50 -0600635
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300636$(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 +0100637 $(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 -0600638
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300639$(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 +0100640 $(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 -0600641
Michael Witten8796cb92011-02-02 11:57:41 -0600642$(OUTPUT)perf-%: %.o $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100643 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200644
Ingo Molnard24e4732009-04-20 13:32:07 +0200645$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
Michael Witten8796cb92011-02-02 11:57:41 -0600646$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
Ingo Molnard24e4732009-04-20 13:32:07 +0200647
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300648# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
649# we depend the various files onto their directories.
650DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
Kusanagi Kouichi39cfae62010-09-26 14:17:42 -0300651$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300652# In the second step, we make a rule to actually create these directories
653$(sort $(dir $(DIRECTORY_DEPS))):
654 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
655
Ingo Molnard24e4732009-04-20 13:32:07 +0200656$(LIB_FILE): $(LIB_OBJS)
657 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
658
Namhyung Kim59f3bea2012-05-22 18:03:53 +0900659# libtraceevent.a
660$(LIBTRACEEVENT):
Robert Richter2ede8302012-08-07 19:43:12 +0200661 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a
Steven Rostedtd0e7b852012-04-06 00:47:54 +0200662
David Aherneea9b682012-09-05 18:53:36 -0600663$(LIBTRACEEVENT)-clean:
664 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
665
Borislav Petkov85c66be2013-02-20 16:32:30 +0100666# if subdir is set, we've been called from above so target has been built
667# already
668$(LIBLK):
669ifeq ($(subdir),)
670 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a
671endif
672
673$(LIBLK)-clean:
674ifeq ($(subdir),)
675 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
676endif
677
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800678help:
679 @echo 'Perf make targets:'
680 @echo ' doc - make *all* documentation (see below)'
681 @echo ' man - make manpage documentation (access with man <foo>)'
682 @echo ' html - make html documentation'
683 @echo ' info - make GNU info documentation (access with info <foo>)'
684 @echo ' pdf - make pdf documentation'
685 @echo ' TAGS - use etags to make tag information for source browsing'
686 @echo ' tags - use ctags to make tag information for source browsing'
687 @echo ' cscope - use cscope to make interactive browsing database'
688 @echo ''
689 @echo 'Perf install targets:'
690 @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed'
691 @echo ' HINT: use "make prefix=<path> <install target>" to install to a particular'
692 @echo ' path like make prefix=/usr/local install install-doc'
693 @echo ' install - install compiled binaries'
694 @echo ' install-doc - install *all* documentation'
695 @echo ' install-man - install manpage documentation'
696 @echo ' install-html - install html documentation'
697 @echo ' install-info - install GNU info documentation'
698 @echo ' install-pdf - install pdf documentation'
699 @echo ''
700 @echo ' quick-install-doc - alias for quick-install-man'
701 @echo ' quick-install-man - install the documentation quickly'
702 @echo ' quick-install-html - install the html documentation quickly'
703 @echo ''
704 @echo 'Perf maintainer targets:'
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800705 @echo ' clean - clean all binary objects and build output'
706
Ingo Molnarc1c23652009-05-30 12:38:51 +0200707
Namhyung Kim536e2b02012-10-26 17:55:49 +0900708DOC_TARGETS := doc man html info pdf
Ingo Molnarc1c23652009-05-30 12:38:51 +0200709
Namhyung Kim536e2b02012-10-26 17:55:49 +0900710INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
711INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
Ingo Molnarc1c23652009-05-30 12:38:51 +0200712
Namhyung Kim536e2b02012-10-26 17:55:49 +0900713# 'make doc' should call 'make -C Documentation all'
714$(DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900715 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200716
Ingo Molnard24e4732009-04-20 13:32:07 +0200717TAGS:
718 $(RM) TAGS
719 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
720
721tags:
722 $(RM) tags
723 $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
724
725cscope:
726 $(RM) cscope*
727 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
728
729### Detect prefix changes
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100730TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
Ingo Molnar07800602009-04-20 15:00:56 +0200731 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
Ingo Molnard24e4732009-04-20 13:32:07 +0200732
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300733$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
Ingo Molnard24e4732009-04-20 13:32:07 +0200734 @FLAGS='$(TRACK_CFLAGS)'; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300735 if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
Ingo Molnard24e4732009-04-20 13:32:07 +0200736 echo 1>&2 " * new build flags or prefix"; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300737 echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200738 fi
739
Ingo Molnard24e4732009-04-20 13:32:07 +0200740### Testing rules
741
Ingo Molnard24e4732009-04-20 13:32:07 +0200742# GNU make supports exporting all variables by "export" without parameters.
743# However, the environment gets quite big, and some programs have problems
744# with that.
745
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300746check: $(OUTPUT)common-cmds.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200747 if sparse; \
748 then \
Ingo Molnar148be2c2009-04-27 08:02:14 +0200749 for i in *.c */*.c; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200750 do \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100751 sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200752 done; \
753 else \
Ingo Molnard24e4732009-04-20 13:32:07 +0200754 exit 1; \
755 fi
756
Ingo Molnard24e4732009-04-20 13:32:07 +0200757### Installation rules
758
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300759install-bin: all
Ingo Molnard24e4732009-04-20 13:32:07 +0200760 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
Michael Witten8796cb92011-02-02 11:57:41 -0600761 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600762 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
763 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300764 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600765 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
766 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
767 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600768 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
Tom Zanussi4d161f02010-01-27 02:27:58 -0600769 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600770 $(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 -0600771 $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
772 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Namhyung Kimb25085b2012-08-09 16:31:53 +0200773 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
774 $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
Jiri Olsad898b242012-10-30 23:02:05 +0100775 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
776 $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
777 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
778 $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
Tom Zanussi82d156c2010-01-27 02:27:55 -0600779
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300780install: install-bin try-install-man
781
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200782install-python_ext:
783 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
784
Namhyung Kim536e2b02012-10-26 17:55:49 +0900785# 'make install-doc' should call 'make -C Documentation install'
786$(INSTALL_DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900787 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200788
Ingo Molnard24e4732009-04-20 13:32:07 +0200789### Cleaning rules
790
Borislav Petkov85c66be2013-02-20 16:32:30 +0100791clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean
Kusanagi Kouichi8b7e0b32011-08-07 17:39:31 +0900792 $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
Michael Wittena3d1ee12011-02-02 14:22:08 -0600793 $(RM) $(ALL_PROGRAMS) perf
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300794 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
Namhyung Kim615d7742012-10-26 17:55:50 +0900795 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
Michael Wittena3d1ee12011-02-02 14:22:08 -0600796 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
Palmer Cox7f309ed2012-07-29 17:54:43 -0400797 $(RM) $(OUTPUT)util/*-bison*
798 $(RM) $(OUTPUT)util/*-flex*
Michael Wittenced465c2011-04-02 21:46:09 +0000799 $(python-clean)
Ingo Molnard24e4732009-04-20 13:32:07 +0200800
Borislav Petkov85c66be2013-02-20 16:32:30 +0100801.PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK)
Ingo Molnard24e4732009-04-20 13:32:07 +0200802.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
Ingo Molnar07800602009-04-20 15:00:56 +0200803.PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS