blob: 8f50afe09c02b643453bda7a186ff5ca72ed9e77 [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
85STRIP ?= strip
86
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
Borislav Petkov85c66be2013-02-20 16:32:30 +0100124LK_PATH=$(LK_DIR)
125
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300126ifneq ($(OUTPUT),)
127 TE_PATH=$(OUTPUT)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100128ifneq ($(subdir),)
129 LK_PATH=$(OUTPUT)$(LK_DIR)
130else
131 LK_PATH=$(OUTPUT)
132endif
Arnaldo Carvalho de Melo45bff412012-10-18 11:38:35 -0300133else
134 TE_PATH=$(TRACE_EVENT_DIR)
135endif
136
137LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900138export LIBTRACEEVENT
139
Borislav Petkov85c66be2013-02-20 16:32:30 +0100140LIBLK = $(LK_PATH)liblk.a
141export LIBLK
142
Namhyung Kim3cde41b2012-11-14 13:39:50 +0900143# python extension build directories
144PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
145PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
146PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
147export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
148
149python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
150
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900151PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
Naohiro Aota707ef2e2013-03-24 22:37:54 +0900152PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT)
Namhyung Kim6a5c13af2012-02-12 19:45:24 +0900153
Namhyung Kime4898332012-09-28 18:31:58 +0900154$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100155 $(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200156 --quiet build_ext; \
157 mkdir -p $(OUTPUT)python && \
158 cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
Ingo Molnar07800602009-04-20 15:00:56 +0200159#
160# No Perl scripts right now:
161#
162
Michael Witten0a54fb62011-02-02 12:04:27 -0600163SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
Ingo Molnard24e4732009-04-20 13:32:07 +0200164
Ingo Molnar07800602009-04-20 15:00:56 +0200165#
Ingo Molnar125e7022009-04-20 16:13:46 +0200166# Single 'perf' binary right now:
Ingo Molnar07800602009-04-20 15:00:56 +0200167#
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300168PROGRAMS += $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200169
Ingo Molnar07800602009-04-20 15:00:56 +0200170# what 'all' will build and 'install' will install, in perfexecdir
Arnaldo Carvalho de Melo978f6262011-02-01 16:40:51 -0200171ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200172
Ingo Molnar07800602009-04-20 15:00:56 +0200173# what 'all' will build but not install in perfexecdir
Michael Witten8796cb92011-02-02 11:57:41 -0600174OTHER_PROGRAMS = $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200175
176# Set paths to tools early so that they can be used for version tests.
177ifndef SHELL_PATH
178 SHELL_PATH = /bin/sh
179endif
180ifndef PERL_PATH
181 PERL_PATH = /usr/bin/perl
182endif
183
184export PERL_PATH
185
Eric Sandeene6048fb2012-09-20 21:31:44 -0500186$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
Jiri Olsa82ba1f22012-05-21 09:12:50 +0200187 $(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 -0300188
Jiri Olsa024e6c92012-04-11 12:39:51 +0200189$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800190 $(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 -0300191
Eric Sandeene6048fb2012-09-20 21:31:44 -0500192$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300193 $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
194
Jiri Olsa024e6c92012-04-11 12:39:51 +0200195$(OUTPUT)util/pmu-bison.c: util/pmu.y
Vinson Lee85df3b32013-02-13 13:48:58 -0800196 $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
Ingo Molnar65f3e562012-03-29 13:08:38 -0300197
Jiri Olsa024e6c92012-04-11 12:39:51 +0200198$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
199$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
Ingo Molnar65f3e562012-03-29 13:08:38 -0300200
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300201LIB_FILE=$(OUTPUT)libperf.a
Ingo Molnard24e4732009-04-20 13:32:07 +0200202
Ingo Molnar7d380c82012-10-14 10:40:57 +0200203LIB_H += ../../include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300204LIB_H += ../../include/linux/rbtree.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300205LIB_H += ../../include/linux/list.h
Ingo Molnar7d380c82012-10-14 10:40:57 +0200206LIB_H += ../../include/uapi/linux/const.h
Hitoshi Mitake18e97e02010-01-30 20:43:24 +0900207LIB_H += ../../include/linux/hash.h
Masami Hiramatsu97698332009-10-16 20:08:18 -0400208LIB_H += ../../include/linux/stringify.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200209LIB_H += util/include/linux/bitmap.h
210LIB_H += util/include/linux/bitops.h
211LIB_H += util/include/linux/compiler.h
Arnaldo Carvalho de Melo75911c92011-05-26 10:13:38 -0300212LIB_H += util/include/linux/const.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200213LIB_H += util/include/linux/ctype.h
214LIB_H += util/include/linux/kernel.h
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -0300215LIB_H += util/include/linux/list.h
Jiri Olsa2c86bf12012-03-26 11:17:05 +0200216LIB_H += util/include/linux/export.h
Irina Tirdeaf8fcd772012-09-11 01:14:58 +0300217LIB_H += util/include/linux/magic.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200218LIB_H += util/include/linux/poison.h
219LIB_H += util/include/linux/prefetch.h
220LIB_H += util/include/linux/rbtree.h
Markus Trippelsdorf871a0592012-10-09 20:01:56 +0200221LIB_H += util/include/linux/rbtree_augmented.h
Arnaldo Carvalho de Melo20639c12009-10-19 15:11:36 -0200222LIB_H += util/include/linux/string.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200223LIB_H += util/include/linux/types.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900224LIB_H += util/include/linux/linkage.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200225LIB_H += util/include/asm/asm-offsets.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200226LIB_H += util/include/asm/bug.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200227LIB_H += util/include/asm/byteorder.h
Arnaldo Carvalho de Melofb720142010-04-30 19:31:12 -0300228LIB_H += util/include/asm/hweight.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200229LIB_H += util/include/asm/swab.h
230LIB_H += util/include/asm/system.h
Arnaldo Carvalho de Melo79b9ad32009-10-19 15:31:31 -0200231LIB_H += util/include/asm/uaccess.h
Ian Munsiecd932c52010-04-20 16:58:32 +1000232LIB_H += util/include/dwarf-regs.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900233LIB_H += util/include/asm/dwarf2.h
234LIB_H += util/include/asm/cpufeature.h
Ingo Molnareae7a752012-03-14 12:42:34 -0300235LIB_H += util/include/asm/unistd_32.h
236LIB_H += util/include/asm/unistd_64.h
Thomas Gleixner6eda5832009-05-01 18:29:57 +0200237LIB_H += perf.h
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200238LIB_H += util/annotate.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200239LIB_H += util/cache.h
240LIB_H += util/callchain.h
Arnaldo Carvalho de Melo7b2567c2010-02-03 16:52:04 -0200241LIB_H += util/build-id.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200242LIB_H += util/debug.h
Jiri Olsae90fda02012-01-27 15:34:22 +0100243LIB_H += util/sysfs.h
Jiri Olsacd82a322012-03-15 20:09:17 +0100244LIB_H += util/pmu.h
Arnaldo Carvalho de Meloec218fc2009-10-03 20:30:48 -0300245LIB_H += util/event.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200246LIB_H += util/evsel.h
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200247LIB_H += util/evlist.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200248LIB_H += util/exec_cmd.h
Peter Zijlstra7c6a1c62009-06-25 17:05:54 +0200249LIB_H += util/types.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200250LIB_H += util/levenshtein.h
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300251LIB_H += util/machine.h
Arnaldo Carvalho de Melo4a58e612009-12-27 21:37:00 -0200252LIB_H += util/map.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200253LIB_H += util/parse-options.h
Ingo Molnar8ad8db32009-05-26 11:10:09 +0200254LIB_H += util/parse-events.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200255LIB_H += util/quote.h
256LIB_H += util/util.h
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200257LIB_H += util/xyarray.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200258LIB_H += util/header.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200259LIB_H += util/help.h
Arnaldo Carvalho de Melo94c744b2009-12-11 21:24:02 -0200260LIB_H += util/session.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200261LIB_H += util/strbuf.h
Arnaldo Carvalho de Melo25903402009-06-30 19:01:20 -0300262LIB_H += util/strlist.h
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900263LIB_H += util/strfilter.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200264LIB_H += util/svghelper.h
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -0200265LIB_H += util/tool.h
Ingo Molnar148be2c2009-04-27 08:02:14 +0200266LIB_H += util/run-command.h
Ingo Molnara930d2c2009-05-27 09:50:13 +0200267LIB_H += util/sigchain.h
Jiri Olsacdd059d2012-10-27 23:18:32 +0200268LIB_H += util/dso.h
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300269LIB_H += util/symbol.h
Ingo Molnar8fc03212009-06-04 15:19:47 +0200270LIB_H += util/color.h
Brice Goglin8d513272009-08-07 13:55:24 +0200271LIB_H += util/values.h
John Kacurdd68ada2009-09-24 18:02:49 +0200272LIB_H += util/sort.h
John Kacur3d1d07e2009-09-28 15:32:55 +0200273LIB_H += util/hist.h
Arnaldo Carvalho de Melo1b46cdd2009-09-28 14:48:46 -0300274LIB_H += util/thread.h
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200275LIB_H += util/thread_map.h
Arnaldo Carvalho de Melo049ae802009-12-27 21:36:58 -0200276LIB_H += util/trace-event.h
Masami Hiramatsu57d250d2009-11-30 19:19:34 -0500277LIB_H += util/probe-finder.h
Masami Hiramatsue0d153c2011-06-27 16:27:27 +0900278LIB_H += util/dwarf-aux.h
Masami Hiramatsu50656ee2009-11-30 19:19:58 -0500279LIB_H += util/probe-event.h
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300280LIB_H += util/pstack.h
Paul Mackerrasa12b51c2010-03-10 20:36:09 +1100281LIB_H += util/cpumap.h
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200282LIB_H += util/top.h
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900283LIB_H += $(ARCH_INCLUDE)
Stephane Eranian023695d2011-02-14 11:20:01 +0200284LIB_H += util/cgroup.h
Namhyung Kim59f3bea2012-05-22 18:03:53 +0900285LIB_H += $(TRACE_EVENT_DIR)event-parse.h
Namhyung Kim12864b32012-04-26 14:15:22 +0900286LIB_H += util/target.h
David Ahern37bbd3f2012-07-30 22:31:32 -0600287LIB_H += util/rblist.h
David Ahern70b40c42012-07-30 22:31:34 -0600288LIB_H += util/intlist.h
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200289LIB_H += util/perf_regs.h
Jiri Olsa71ad0f52012-08-07 15:20:46 +0200290LIB_H += util/unwind.h
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200291LIB_H += util/vdso.h
Namhyung Kim75291422012-11-15 01:47:40 +0900292LIB_H += ui/helpline.h
293LIB_H += ui/progress.h
294LIB_H += ui/util.h
295LIB_H += ui/ui.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200296
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300297LIB_OBJS += $(OUTPUT)util/abspath.o
298LIB_OBJS += $(OUTPUT)util/alias.o
Arnaldo Carvalho de Melo78f7def2011-02-04 09:45:46 -0200299LIB_OBJS += $(OUTPUT)util/annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300300LIB_OBJS += $(OUTPUT)util/build-id.o
301LIB_OBJS += $(OUTPUT)util/config.o
302LIB_OBJS += $(OUTPUT)util/ctype.o
Jiri Olsae90fda02012-01-27 15:34:22 +0100303LIB_OBJS += $(OUTPUT)util/sysfs.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100304LIB_OBJS += $(OUTPUT)util/pmu.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300305LIB_OBJS += $(OUTPUT)util/environment.o
306LIB_OBJS += $(OUTPUT)util/event.o
Arnaldo Carvalho de Melo361c99a2011-01-11 20:56:53 -0200307LIB_OBJS += $(OUTPUT)util/evlist.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200308LIB_OBJS += $(OUTPUT)util/evsel.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300309LIB_OBJS += $(OUTPUT)util/exec_cmd.o
310LIB_OBJS += $(OUTPUT)util/help.o
311LIB_OBJS += $(OUTPUT)util/levenshtein.o
312LIB_OBJS += $(OUTPUT)util/parse-options.o
313LIB_OBJS += $(OUTPUT)util/parse-events.o
314LIB_OBJS += $(OUTPUT)util/path.o
315LIB_OBJS += $(OUTPUT)util/rbtree.o
316LIB_OBJS += $(OUTPUT)util/bitmap.o
317LIB_OBJS += $(OUTPUT)util/hweight.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300318LIB_OBJS += $(OUTPUT)util/run-command.o
319LIB_OBJS += $(OUTPUT)util/quote.o
320LIB_OBJS += $(OUTPUT)util/strbuf.o
321LIB_OBJS += $(OUTPUT)util/string.o
322LIB_OBJS += $(OUTPUT)util/strlist.o
Masami Hiramatsu68baa432011-01-20 23:15:30 +0900323LIB_OBJS += $(OUTPUT)util/strfilter.o
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -0200324LIB_OBJS += $(OUTPUT)util/top.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300325LIB_OBJS += $(OUTPUT)util/usage.o
326LIB_OBJS += $(OUTPUT)util/wrapper.o
327LIB_OBJS += $(OUTPUT)util/sigchain.o
Jiri Olsacdd059d2012-10-27 23:18:32 +0200328LIB_OBJS += $(OUTPUT)util/dso.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300329LIB_OBJS += $(OUTPUT)util/symbol.o
Namhyung Kime5a18452012-08-06 13:41:20 +0900330LIB_OBJS += $(OUTPUT)util/symbol-elf.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300331LIB_OBJS += $(OUTPUT)util/color.o
332LIB_OBJS += $(OUTPUT)util/pager.o
333LIB_OBJS += $(OUTPUT)util/header.o
334LIB_OBJS += $(OUTPUT)util/callchain.o
335LIB_OBJS += $(OUTPUT)util/values.o
336LIB_OBJS += $(OUTPUT)util/debug.o
Arnaldo Carvalho de Melo9d2f8e22012-10-06 15:43:20 -0300337LIB_OBJS += $(OUTPUT)util/machine.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300338LIB_OBJS += $(OUTPUT)util/map.o
Arnaldo Carvalho de Melo3e1bbdc32010-05-14 20:05:21 -0300339LIB_OBJS += $(OUTPUT)util/pstack.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300340LIB_OBJS += $(OUTPUT)util/session.o
341LIB_OBJS += $(OUTPUT)util/thread.o
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -0200342LIB_OBJS += $(OUTPUT)util/thread_map.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300343LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
Jiri Olsa89812fc2012-03-15 20:09:15 +0100344LIB_OBJS += $(OUTPUT)util/parse-events-flex.o
345LIB_OBJS += $(OUTPUT)util/parse-events-bison.o
Jiri Olsacd82a322012-03-15 20:09:17 +0100346LIB_OBJS += $(OUTPUT)util/pmu-flex.o
347LIB_OBJS += $(OUTPUT)util/pmu-bison.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300348LIB_OBJS += $(OUTPUT)util/trace-event-read.o
349LIB_OBJS += $(OUTPUT)util/trace-event-info.o
350LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
351LIB_OBJS += $(OUTPUT)util/svghelper.o
352LIB_OBJS += $(OUTPUT)util/sort.o
353LIB_OBJS += $(OUTPUT)util/hist.o
354LIB_OBJS += $(OUTPUT)util/probe-event.o
355LIB_OBJS += $(OUTPUT)util/util.o
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -0200356LIB_OBJS += $(OUTPUT)util/xyarray.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300357LIB_OBJS += $(OUTPUT)util/cpumap.o
Stephane Eranian023695d2011-02-14 11:20:01 +0200358LIB_OBJS += $(OUTPUT)util/cgroup.o
Namhyung Kim12864b32012-04-26 14:15:22 +0900359LIB_OBJS += $(OUTPUT)util/target.o
David Ahern37bbd3f2012-07-30 22:31:32 -0600360LIB_OBJS += $(OUTPUT)util/rblist.o
David Ahern70b40c42012-07-30 22:31:34 -0600361LIB_OBJS += $(OUTPUT)util/intlist.o
Jiri Olsa7dbf4dc2012-09-10 18:50:19 +0200362LIB_OBJS += $(OUTPUT)util/vdso.o
Xiao Guangrong0007ece2012-09-17 16:31:14 +0800363LIB_OBJS += $(OUTPUT)util/stat.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900364
Namhyung Kim59ed16b2012-11-13 22:30:35 +0900365LIB_OBJS += $(OUTPUT)ui/setup.o
Namhyung Kime6e90462012-08-16 17:14:50 +0900366LIB_OBJS += $(OUTPUT)ui/helpline.o
Namhyung Kim688f2f52012-11-13 22:30:32 +0900367LIB_OBJS += $(OUTPUT)ui/progress.o
Namhyung Kim75291422012-11-15 01:47:40 +0900368LIB_OBJS += $(OUTPUT)ui/util.o
Namhyung Kimea251d52012-09-03 11:53:06 +0900369LIB_OBJS += $(OUTPUT)ui/hist.o
Namhyung Kim7ccf4f92012-08-20 13:52:05 +0900370LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200371
Irina Tirdea68e94f42012-10-16 02:33:38 +0300372LIB_OBJS += $(OUTPUT)arch/common.o
373
Jiri Olsa945aea22012-10-30 23:01:43 +0100374LIB_OBJS += $(OUTPUT)tests/parse-events.o
375LIB_OBJS += $(OUTPUT)tests/dso-data.o
Jiri Olsa52502bf2012-10-31 15:52:47 +0100376LIB_OBJS += $(OUTPUT)tests/attr.o
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +0100377LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
Jiri Olsad3b59a32012-11-10 01:46:42 +0100378LIB_OBJS += $(OUTPUT)tests/open-syscall.o
Jiri Olsabd905172012-11-10 01:46:43 +0100379LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
Jiri Olsadc447ee2012-11-10 01:46:49 +0100380LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
Jiri Olsaa65b9c62012-11-10 01:46:44 +0100381LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
Jiri Olsa16d00fe2012-11-10 01:46:45 +0100382LIB_OBJS += $(OUTPUT)tests/perf-record.o
Jiri Olsabacf7e52012-11-10 01:46:46 +0100383LIB_OBJS += $(OUTPUT)tests/rdpmc.o
Jiri Olsacfffae22012-11-10 01:46:47 +0100384LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
Jiri Olsa5e24a092012-11-10 01:46:48 +0100385LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
Jiri Olsacff7f952012-11-10 01:46:50 +0100386LIB_OBJS += $(OUTPUT)tests/pmu.o
Namhyung Kimf8ebb0c2012-12-10 17:29:57 +0900387LIB_OBJS += $(OUTPUT)tests/hists_link.o
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300388LIB_OBJS += $(OUTPUT)tests/python-use.o
Jiri Olsa5a6bef42013-03-10 19:41:10 +0100389LIB_OBJS += $(OUTPUT)tests/bp_signal.o
Jiri Olsa06933e32013-03-10 19:41:11 +0100390LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
Namhyung Kimd723a552013-03-15 14:58:11 +0900391LIB_OBJS += $(OUTPUT)tests/task-exit.o
Namhyung Kimbc96b362013-03-18 11:41:47 +0900392LIB_OBJS += $(OUTPUT)tests/sw-clock.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100393
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300394BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300395BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900396# Benchmark modules
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300397BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
398BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900399ifeq ($(RAW_ARCH),x86_64)
400BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200401BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
Hitoshi Mitakeea7872b2010-11-25 16:04:53 +0900402endif
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300403BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
Jan Beulichbe3de802012-01-24 10:03:22 -0200404BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
Hitoshi Mitakebfde82e2009-11-05 09:31:37 +0900405
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300406BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
Arnaldo Carvalho de Melo43adec92011-03-15 11:04:13 -0300407BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300408BUILTIN_OBJS += $(OUTPUT)builtin-help.o
409BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
410BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
411BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
412BUILTIN_OBJS += $(OUTPUT)builtin-list.o
413BUILTIN_OBJS += $(OUTPUT)builtin-record.o
414BUILTIN_OBJS += $(OUTPUT)builtin-report.o
415BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
416BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
417BUILTIN_OBJS += $(OUTPUT)builtin-top.o
Ingo Molnar133dc4c2010-11-16 18:45:39 +0100418BUILTIN_OBJS += $(OUTPUT)builtin-script.o
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300419BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
420BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
421BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800422BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
Tom Zanussi454c4072010-05-01 01:41:20 -0500423BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
Jiri Olsa945aea22012-10-30 23:01:43 +0100424BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
Stephane Eranian028f12e2013-01-24 16:10:38 +0100425BUILTIN_OBJS += $(OUTPUT)builtin-mem.o
Ingo Molnard24e4732009-04-20 13:32:07 +0200426
Borislav Petkov85c66be2013-02-20 16:32:30 +0100427PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
Ingo Molnard24e4732009-04-20 13:32:07 +0200428
Ingo Molnard24e4732009-04-20 13:32:07 +0200429# We choose to avoid "if .. else if .. else .. endif endif"
430# because maintaining the nesting to match is a pain. If
431# we had "elif" things would have been much nicer...
432
Ian Munsiecd932c52010-04-20 16:58:32 +1000433-include arch/$(ARCH)/Makefile
434
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300435ifneq ($(OUTPUT),)
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100436 CFLAGS += -I$(OUTPUT)
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300437endif
438
Namhyung Kim393be2e2012-08-06 13:41:21 +0900439ifdef NO_LIBELF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900440EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
441
442# Remove ELF/DWARF dependent codes
443LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
444LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
445LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))
446LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS))
447
448BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
449
450# Use minimal symbol handling
451LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
452
453else # NO_LIBELF
Masami Hiramatsuca721e42010-03-22 13:10:27 -0300454ifndef NO_DWARF
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300455 LIB_OBJS += $(OUTPUT)util/probe-finder.o
Masami Hiramatsue0d153c2011-06-27 16:27:27 +0900456 LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
Ian Munsiecd932c52010-04-20 16:58:32 +1000457endif # NO_DWARF
Namhyung Kim393be2e2012-08-06 13:41:21 +0900458endif # NO_LIBELF
Masami Hiramatsu4ea42b12009-10-08 17:17:38 -0400459
Namhyung Kim95485b12012-09-28 18:32:00 +0900460ifndef NO_LIBUNWIND
Jiri Olsa71ad0f52012-08-07 15:20:46 +0200461 LIB_OBJS += $(OUTPUT)util/unwind.o
Jiri Olsa6a40cd92012-08-07 15:20:44 +0200462endif
463
Namhyung Kimf315e162012-09-28 18:32:01 +0900464ifndef NO_LIBAUDIT
Jiri Olsaa8279522013-03-25 00:54:36 +0100465 BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
Namhyung Kim4d290892012-09-27 20:23:38 +0900466endif
467
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -0300468ifndef NO_SLANG
Jiri Olsa4a8f8882013-03-25 00:56:08 +0100469 LIB_OBJS += $(OUTPUT)ui/browser.o
470 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
471 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
472 LIB_OBJS += $(OUTPUT)ui/browsers/map.o
473 LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
474 LIB_OBJS += $(OUTPUT)ui/tui/setup.o
475 LIB_OBJS += $(OUTPUT)ui/tui/util.o
476 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
477 LIB_OBJS += $(OUTPUT)ui/tui/progress.o
478 LIB_H += ui/browser.h
479 LIB_H += ui/browsers/map.h
480 LIB_H += ui/keysyms.h
481 LIB_H += ui/libslang.h
Jamie Ilescc835752009-12-11 09:21:00 +0000482endif
Tom Zanussi16c632d2009-11-25 01:15:48 -0600483
Namhyung Kimf9f526e2012-09-28 18:32:03 +0900484ifndef NO_GTK2
Jiri Olsa58cabf62013-03-18 00:09:24 +0100485 LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
486 LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
487 LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
488 LIB_OBJS += $(OUTPUT)ui/gtk/util.o
489 LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
490 LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
491 LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
Pekka Enbergc31a9452012-03-19 15:13:29 -0300492endif
493
Jiri Olsa3082cb32013-03-18 00:19:44 +0100494ifndef NO_LIBPERL
495 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
496 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
Tom Zanussi16c632d2009-11-25 01:15:48 -0600497endif
498
Jiri Olsa6e533cf2013-03-18 00:35:32 +0100499ifndef NO_LIBPYTHON
500 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
501 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600502endif
503
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200504ifeq ($(NO_PERF_REGS),0)
505 ifeq ($(ARCH),x86)
506 LIB_H += arch/x86/include/perf_regs.h
507 endif
Jiri Olsa2bcd3552012-08-07 15:20:43 +0200508endif
Kirill A. Shutemovf4e7ac02010-08-21 03:38:20 +0300509
Peter Hurley79d824e2013-01-27 20:51:22 -0500510ifndef NO_LIBNUMA
Jiri Olsa58a0abd2013-03-18 00:45:27 +0100511 BUILTIN_OBJS += $(OUTPUT)bench/numa.o
Peter Hurley79d824e2013-01-27 20:51:22 -0500512endif
513
Ingo Molnard24e4732009-04-20 13:32:07 +0200514ifdef ASCIIDOC8
515 export ASCIIDOC8
516endif
517
Mathias Krause203db292011-06-15 23:03:38 +0200518LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
Ingo Molnard24e4732009-04-20 13:32:07 +0200519
Michael Wittena3d1ee12011-02-02 14:22:08 -0600520export INSTALL SHELL_PATH
Ingo Molnard24e4732009-04-20 13:32:07 +0200521
Ingo Molnard24e4732009-04-20 13:32:07 +0200522### Build rules
523
524SHELL = $(SHELL_PATH)
525
Michael Wittena3d1ee12011-02-02 14:22:08 -0600526all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200527
528please_set_SHELL_PATH_to_a_more_modern_shell:
529 @$$(:)
530
531shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
532
Michael Witten8796cb92011-02-02 11:57:41 -0600533strip: $(PROGRAMS) $(OUTPUT)perf
534 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
Ingo Molnard24e4732009-04-20 13:32:07 +0200535
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300536$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Namhyung Kim3cecaa22013-01-16 20:59:53 +0900537 $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
Ingo Molnar07800602009-04-20 15:00:56 +0200538 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100539 $(CFLAGS) -c $(filter %.c,$^) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200540
Michael Witten8796cb92011-02-02 11:57:41 -0600541$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100542 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(OUTPUT)perf.o \
Tom Zanussif2481f32010-08-24 00:23:50 -0500543 $(BUILTIN_OBJS) $(LIBS) -o $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200544
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300545$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100546 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200547 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
548 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
549 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200550
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300551$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100552 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Arjan van de Ven10274982009-09-12 07:53:05 +0200553 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
554 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
555 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
556
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300557$(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
Ingo Molnard24e4732009-04-20 13:32:07 +0200558
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300559$(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
Mulyadi Santosa1ad05602009-09-26 02:01:41 +0700560 $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
Ingo Molnard24e4732009-04-20 13:32:07 +0200561
Michael Wittena3d1ee12011-02-02 14:22:08 -0600562$(SCRIPTS) : % : %.sh
563 $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
Ingo Molnard24e4732009-04-20 13:32:07 +0200564
Ingo Molnar07800602009-04-20 15:00:56 +0200565# These can record PERF_VERSION
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300566$(OUTPUT)perf.o perf.spec \
Michael Wittena3d1ee12011-02-02 14:22:08 -0600567 $(SCRIPTS) \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300568 : $(OUTPUT)PERF-VERSION-FILE
Ingo Molnard24e4732009-04-20 13:32:07 +0200569
Jiri Olsa89812fc2012-03-15 20:09:15 +0100570.SUFFIXES:
571.SUFFIXES: .o .c .S .s
572
Ingo Molnar65f3e562012-03-29 13:08:38 -0300573# These two need to be here so that when O= is not used they take precedence
574# over the general rule for .o
575
576$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100577 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300578
579$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100580 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
Ingo Molnar65f3e562012-03-29 13:08:38 -0300581
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300582$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100583 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000584$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100585 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300586$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100587 $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300588$(OUTPUT)%.o: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100589 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
Jan Beulich4a3d2d92012-03-08 09:29:28 +0000590$(OUTPUT)%.s: %.S
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100591 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200592
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300593$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100594 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Ingo Molnar07800602009-04-20 15:00:56 +0200595 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
Ingo Molnard24e4732009-04-20 13:32:07 +0200596 '-DPREFIX="$(prefix_SQ)"' \
597 $<
598
Jiri Olsad898b242012-10-30 23:02:05 +0100599$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100600 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Namhyung Kim000ae332012-12-17 16:25:01 +0900601 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
Jiri Olsad898b242012-10-30 23:02:05 +0100602 $<
603
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300604$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100605 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
Jiri Olsa09ecbb02012-12-19 09:52:21 +0100606 -DPYTHONPATH='"$(OUTPUT)python"' \
Namhyung Kim000ae332012-12-17 16:25:01 +0900607 -DPYTHON='"$(PYTHON_WORD)"' \
608 $<
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -0300609
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300610$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100611 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Ingo Molnard24e4732009-04-20 13:32:07 +0200612
Namhyung Kimaca7a942012-04-04 00:14:26 -0700613$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100614 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Meloef8f34a2010-08-06 17:35:02 -0300615
Namhyung Kimaca7a942012-04-04 00:14:26 -0700616$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100617 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melo211ef122010-08-10 14:54:09 -0300618
Namhyung Kimaca7a942012-04-04 00:14:26 -0700619$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100620 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melod1b4f242010-08-10 15:49:07 -0300621
Namhyung Kimaca7a942012-04-04 00:14:26 -0700622$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100623 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Arnaldo Carvalho de Melob1b02672010-08-10 15:37:34 -0300624
Feng Tang66517822012-10-30 11:56:04 +0800625$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100626 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
Feng Tang66517822012-10-30 11:56:04 +0800627
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300628$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100629 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -0300630
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300631$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100632 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
Kirill A. Shutemov043d1a52012-07-24 00:04:07 +0300633
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300634$(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 +0100635 $(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 -0600636
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300637$(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 +0100638 $(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 -0600639
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300640$(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 +0100641 $(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 -0600642
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300643$(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 +0100644 $(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 -0600645
Michael Witten8796cb92011-02-02 11:57:41 -0600646$(OUTPUT)perf-%: %.o $(PERFLIBS)
Jiri Olsa1e9f7aa2013-03-21 11:41:05 +0100647 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
Ingo Molnard24e4732009-04-20 13:32:07 +0200648
Ingo Molnard24e4732009-04-20 13:32:07 +0200649$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
Michael Witten8796cb92011-02-02 11:57:41 -0600650$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
Ingo Molnard24e4732009-04-20 13:32:07 +0200651
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300652# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
653# we depend the various files onto their directories.
654DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
Kusanagi Kouichi39cfae62010-09-26 14:17:42 -0300655$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
Bernd Petrovitsch033a2732010-08-17 12:22:08 -0300656# In the second step, we make a rule to actually create these directories
657$(sort $(dir $(DIRECTORY_DEPS))):
658 $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
659
Ingo Molnard24e4732009-04-20 13:32:07 +0200660$(LIB_FILE): $(LIB_OBJS)
661 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
662
Namhyung Kim59f3bea2012-05-22 18:03:53 +0900663# libtraceevent.a
664$(LIBTRACEEVENT):
Robert Richter2ede8302012-08-07 19:43:12 +0200665 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) libtraceevent.a
Steven Rostedtd0e7b852012-04-06 00:47:54 +0200666
David Aherneea9b682012-09-05 18:53:36 -0600667$(LIBTRACEEVENT)-clean:
668 $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
669
Borislav Petkov85c66be2013-02-20 16:32:30 +0100670# if subdir is set, we've been called from above so target has been built
671# already
672$(LIBLK):
673ifeq ($(subdir),)
674 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) liblk.a
675endif
676
677$(LIBLK)-clean:
678ifeq ($(subdir),)
679 $(QUIET_SUBDIR0)$(LK_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) clean
680endif
681
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800682help:
683 @echo 'Perf make targets:'
684 @echo ' doc - make *all* documentation (see below)'
685 @echo ' man - make manpage documentation (access with man <foo>)'
686 @echo ' html - make html documentation'
687 @echo ' info - make GNU info documentation (access with info <foo>)'
688 @echo ' pdf - make pdf documentation'
689 @echo ' TAGS - use etags to make tag information for source browsing'
690 @echo ' tags - use ctags to make tag information for source browsing'
691 @echo ' cscope - use cscope to make interactive browsing database'
692 @echo ''
693 @echo 'Perf install targets:'
694 @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed'
695 @echo ' HINT: use "make prefix=<path> <install target>" to install to a particular'
696 @echo ' path like make prefix=/usr/local install install-doc'
697 @echo ' install - install compiled binaries'
698 @echo ' install-doc - install *all* documentation'
699 @echo ' install-man - install manpage documentation'
700 @echo ' install-html - install html documentation'
701 @echo ' install-info - install GNU info documentation'
702 @echo ' install-pdf - install pdf documentation'
703 @echo ''
704 @echo ' quick-install-doc - alias for quick-install-man'
705 @echo ' quick-install-man - install the documentation quickly'
706 @echo ' quick-install-html - install the html documentation quickly'
707 @echo ''
708 @echo 'Perf maintainer targets:'
Jesse Brandeburg4187e262011-02-09 17:11:00 -0800709 @echo ' clean - clean all binary objects and build output'
710
Ingo Molnarc1c23652009-05-30 12:38:51 +0200711
Namhyung Kim536e2b02012-10-26 17:55:49 +0900712DOC_TARGETS := doc man html info pdf
Ingo Molnarc1c23652009-05-30 12:38:51 +0200713
Namhyung Kim536e2b02012-10-26 17:55:49 +0900714INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
715INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
Ingo Molnarc1c23652009-05-30 12:38:51 +0200716
Namhyung Kim536e2b02012-10-26 17:55:49 +0900717# 'make doc' should call 'make -C Documentation all'
718$(DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900719 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200720
Ingo Molnard24e4732009-04-20 13:32:07 +0200721TAGS:
722 $(RM) TAGS
723 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
724
725tags:
726 $(RM) tags
727 $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
728
729cscope:
730 $(RM) cscope*
731 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
732
733### Detect prefix changes
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100734TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
Ingo Molnar07800602009-04-20 15:00:56 +0200735 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
Ingo Molnard24e4732009-04-20 13:32:07 +0200736
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300737$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
Ingo Molnard24e4732009-04-20 13:32:07 +0200738 @FLAGS='$(TRACK_CFLAGS)'; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300739 if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
Ingo Molnard24e4732009-04-20 13:32:07 +0200740 echo 1>&2 " * new build flags or prefix"; \
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300741 echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200742 fi
743
Ingo Molnard24e4732009-04-20 13:32:07 +0200744### Testing rules
745
Ingo Molnard24e4732009-04-20 13:32:07 +0200746# GNU make supports exporting all variables by "export" without parameters.
747# However, the environment gets quite big, and some programs have problems
748# with that.
749
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300750check: $(OUTPUT)common-cmds.h
Ingo Molnard24e4732009-04-20 13:32:07 +0200751 if sparse; \
752 then \
Ingo Molnar148be2c2009-04-27 08:02:14 +0200753 for i in *.c */*.c; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200754 do \
Jiri Olsa9c12cf92013-03-21 11:30:54 +0100755 sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
Ingo Molnard24e4732009-04-20 13:32:07 +0200756 done; \
757 else \
Ingo Molnard24e4732009-04-20 13:32:07 +0200758 exit 1; \
759 fi
760
Ingo Molnard24e4732009-04-20 13:32:07 +0200761### Installation rules
762
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300763install-bin: all
Ingo Molnard24e4732009-04-20 13:32:07 +0200764 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
Michael Witten8796cb92011-02-02 11:57:41 -0600765 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600766 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
767 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300768 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
Tom Zanussibcefe122009-11-25 01:15:49 -0600769 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
770 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
771 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600772 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
Tom Zanussi4d161f02010-01-27 02:27:58 -0600773 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Tom Zanussi7e4b21b2010-01-27 02:27:57 -0600774 $(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 -0600775 $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
776 $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
Namhyung Kimb25085b2012-08-09 16:31:53 +0200777 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'
778 $(INSTALL) bash_completion '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
Jiri Olsad898b242012-10-30 23:02:05 +0100779 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
780 $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'
781 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
782 $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
Tom Zanussi82d156c2010-01-27 02:27:55 -0600783
Arnaldo Carvalho de Melo40c5ec72012-12-11 09:54:21 -0300784install: install-bin try-install-man
785
Jiri Olsa9941c96a2011-07-22 13:33:07 +0200786install-python_ext:
787 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
788
Namhyung Kim536e2b02012-10-26 17:55:49 +0900789# 'make install-doc' should call 'make -C Documentation install'
790$(INSTALL_DOC_TARGETS):
Namhyung Kim615d7742012-10-26 17:55:50 +0900791 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
Ingo Molnarc1c23652009-05-30 12:38:51 +0200792
Ingo Molnard24e4732009-04-20 13:32:07 +0200793### Cleaning rules
794
Borislav Petkov85c66be2013-02-20 16:32:30 +0100795clean: $(LIBTRACEEVENT)-clean $(LIBLK)-clean
Kusanagi Kouichi8b7e0b32011-08-07 17:39:31 +0900796 $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
Michael Wittena3d1ee12011-02-02 14:22:08 -0600797 $(RM) $(ALL_PROGRAMS) perf
Arnaldo Carvalho de Meloc29ede62010-03-27 14:30:45 -0300798 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
Namhyung Kim615d7742012-10-26 17:55:50 +0900799 $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
Michael Wittena3d1ee12011-02-02 14:22:08 -0600800 $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
Palmer Cox7f309ed2012-07-29 17:54:43 -0400801 $(RM) $(OUTPUT)util/*-bison*
802 $(RM) $(OUTPUT)util/*-flex*
Michael Wittenced465c2011-04-02 21:46:09 +0000803 $(python-clean)
Ingo Molnard24e4732009-04-20 13:32:07 +0200804
Borislav Petkov85c66be2013-02-20 16:32:30 +0100805.PHONY: all install clean strip $(LIBTRACEEVENT) $(LIBLK)
Ingo Molnard24e4732009-04-20 13:32:07 +0200806.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
Ingo Molnar07800602009-04-20 15:00:56 +0200807.PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS