Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 1 | include ../scripts/Makefile.include |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 2 | include ../scripts/Makefile.arch |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 3 | |
| 4 | # The default target of this Makefile is... |
| 5 | all: |
| 6 | |
Arnaldo Carvalho de Melo | ca70c24 | 2016-03-18 13:57:20 -0300 | [diff] [blame] | 7 | include ../scripts/utilities.mak |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 8 | |
| 9 | # Define V to have a more verbose compile. |
| 10 | # |
Jiri Olsa | 0695e57 | 2014-02-19 16:52:54 +0100 | [diff] [blame] | 11 | # Define VF to have a more verbose feature check output. |
| 12 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 13 | # Define O to save output files in a separate directory. |
| 14 | # |
| 15 | # Define ARCH as name of target architecture if you want cross-builds. |
| 16 | # |
| 17 | # Define CROSS_COMPILE as prefix name of compiler if you want cross-builds. |
| 18 | # |
| 19 | # Define NO_LIBPERL to disable perl script extension. |
| 20 | # |
| 21 | # Define NO_LIBPYTHON to disable python script extension. |
| 22 | # |
| 23 | # Define PYTHON to point to the python binary if the default |
| 24 | # `python' is not correct; for example: PYTHON=python2 |
| 25 | # |
| 26 | # Define PYTHON_CONFIG to point to the python-config binary if |
| 27 | # the default `$(PYTHON)-config' is not correct. |
| 28 | # |
| 29 | # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 |
| 30 | # |
| 31 | # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72. |
| 32 | # |
| 33 | # Define LDFLAGS=-static to build a static binary. |
| 34 | # |
| 35 | # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds. |
| 36 | # |
David Carrillo-Cisneros | cb281fe | 2017-07-18 18:18:37 -0700 | [diff] [blame] | 37 | # Define EXCLUDE_EXTLIBS=-lmylib to exclude libmylib from the auto-generated |
| 38 | # EXTLIBS. |
| 39 | # |
| 40 | # Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS. |
| 41 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 42 | # Define NO_DWARF if you do not want debug-info analysis feature at all. |
| 43 | # |
| 44 | # Define WERROR=0 to disable treating any warnings as errors. |
| 45 | # |
| 46 | # Define NO_NEWT if you do not want TUI support. (deprecated) |
| 47 | # |
| 48 | # Define NO_SLANG if you do not want TUI support. |
| 49 | # |
| 50 | # Define NO_GTK2 if you do not want GTK+ GUI support. |
| 51 | # |
| 52 | # Define NO_DEMANGLE if you do not want C++ symbol demangling. |
| 53 | # |
| 54 | # Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds) |
| 55 | # |
| 56 | # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf |
| 57 | # backtrace post unwind. |
| 58 | # |
| 59 | # Define NO_BACKTRACE if you do not want stack backtrace debug feature |
| 60 | # |
| 61 | # Define NO_LIBNUMA if you do not want numa perf benchmark |
| 62 | # |
| 63 | # Define NO_LIBAUDIT if you do not want libaudit support |
| 64 | # |
| 65 | # Define NO_LIBBIONIC if you do not want bionic support |
Jiri Olsa | 5ea8415 | 2014-02-19 16:52:57 +0100 | [diff] [blame] | 66 | # |
Stephane Eranian | 8ee4646 | 2015-11-30 10:02:21 +0100 | [diff] [blame] | 67 | # Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support |
| 68 | # used for generating build-ids for ELFs generated by jitdump. |
| 69 | # |
Jiri Olsa | 5ea8415 | 2014-02-19 16:52:57 +0100 | [diff] [blame] | 70 | # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support |
| 71 | # for dwarf backtrace post unwind. |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 72 | # |
| 73 | # Define NO_PERF_READ_VDSO32 if you do not want to build perf-read-vdso32 |
| 74 | # for reading the 32-bit compatibility VDSO in 64-bit mode |
| 75 | # |
| 76 | # Define NO_PERF_READ_VDSOX32 if you do not want to build perf-read-vdsox32 |
| 77 | # for reading the x32 mode 32-bit compatibility VDSO in 64-bit mode |
Namhyung Kim | e92ce12 | 2014-10-31 16:51:38 +0900 | [diff] [blame] | 78 | # |
| 79 | # Define NO_ZLIB if you do not want to support compressed kernel modules |
Jiri Olsa | 53d0a57 | 2015-02-20 23:16:58 +0100 | [diff] [blame] | 80 | # |
Jiri Olsa | 24787af | 2018-01-07 17:03:45 +0100 | [diff] [blame] | 81 | # Define NO_LIBBABELTRACE if you do not want libbabeltrace support |
Jiri Olsa | 53d0a57 | 2015-02-20 23:16:58 +0100 | [diff] [blame] | 82 | # for CTF data format. |
Jiri Olsa | 80a32e5b | 2015-01-29 13:29:39 +0100 | [diff] [blame] | 83 | # |
| 84 | # Define NO_LZMA if you do not want to support compressed (xz) kernel modules |
Adrian Hunter | e31f0d0 | 2015-04-30 17:37:27 +0300 | [diff] [blame] | 85 | # |
| 86 | # Define NO_AUXTRACE if you do not want AUX area tracing support |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 87 | # |
| 88 | # Define NO_LIBBPF if you do not want BPF support |
Jiri Olsa | 96b9e70 | 2016-01-15 04:00:18 +0000 | [diff] [blame] | 89 | # |
Masami Hiramatsu | e26e63b | 2016-07-12 19:05:56 +0900 | [diff] [blame] | 90 | # Define NO_SDT if you do not want to define SDT event in perf tools, |
| 91 | # note that it doesn't disable SDT scanning support. |
| 92 | # |
Jiri Olsa | 96b9e70 | 2016-01-15 04:00:18 +0000 | [diff] [blame] | 93 | # Define FEATURES_DUMP to provide features detection dump file |
| 94 | # and bypass the feature detection |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 95 | # |
| 96 | # Define NO_JVMTI if you do not want jvmti agent built |
Wang Nan | d58ac0b | 2016-11-26 07:03:33 +0000 | [diff] [blame] | 97 | # |
Jiri Olsa | dd1d004 | 2018-11-21 16:43:41 +0100 | [diff] [blame] | 98 | # Define NO_JVMTI_CMLR (debug only) if you do not want to process CMLR |
| 99 | # data for java source lines. |
| 100 | # |
Wang Nan | d58ac0b | 2016-11-26 07:03:33 +0000 | [diff] [blame] | 101 | # Define LIBCLANGLLVM if you DO want builtin clang and llvm support. |
| 102 | # When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if |
| 103 | # llvm-config is not in $PATH. |
Alexey Budankov | 2a07d81 | 2018-11-06 12:03:35 +0300 | [diff] [blame] | 104 | # |
Arnaldo Carvalho de Melo | 1c3b28f | 2019-02-12 14:37:15 -0300 | [diff] [blame] | 105 | # Define CORESIGHT if you DO WANT support for CoreSight trace decoding. |
Alexey Budankov | 2a07d81 | 2018-11-06 12:03:35 +0300 | [diff] [blame] | 106 | # |
| 107 | # Define NO_AIO if you do not want support of Posix AIO based trace |
| 108 | # streaming for record mode. Currently Posix AIO trace streaming is |
| 109 | # supported only when linking with glibc. |
| 110 | # |
Alexey Budankov | 3b1c5d9 | 2019-03-18 20:39:49 +0300 | [diff] [blame] | 111 | # Define NO_LIBZSTD if you do not want support of Zstandard based runtime |
| 112 | # trace compression in record mode. |
| 113 | # |
Mathieu Poirier | aa6292f | 2018-01-17 10:52:10 -0700 | [diff] [blame] | 114 | |
Adrian Hunter | 237fae7 | 2015-08-13 10:14:55 +0300 | [diff] [blame] | 115 | # As per kernel Makefile, avoid funny character set dependencies |
| 116 | unexport LC_ALL |
| 117 | LC_COLLATE=C |
| 118 | LC_NUMERIC=C |
| 119 | export LC_COLLATE LC_NUMERIC |
| 120 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 121 | ifeq ($(srctree),) |
Uwe Kleine-König | e19b7ce | 2016-11-22 09:30:26 +0100 | [diff] [blame] | 122 | srctree := $(patsubst %/,%,$(dir $(CURDIR))) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 123 | srctree := $(patsubst %/,%,$(dir $(srctree))) |
| 124 | #$(info Determined 'srctree' to be $(srctree)) |
| 125 | endif |
| 126 | |
| 127 | ifneq ($(objtree),) |
| 128 | #$(info Determined 'objtree' to be $(objtree)) |
| 129 | endif |
| 130 | |
| 131 | ifneq ($(OUTPUT),) |
| 132 | #$(info Determined 'OUTPUT' to be $(OUTPUT)) |
Jiri Olsa | 9352aab | 2014-12-29 17:42:46 +0100 | [diff] [blame] | 133 | # Adding $(OUTPUT) as a directory to look for source files, |
| 134 | # because use generated output files as sources dependency |
| 135 | # for flex/bison parsers. |
| 136 | VPATH += $(OUTPUT) |
| 137 | export VPATH |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 138 | endif |
| 139 | |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 140 | ifeq ($(V),1) |
| 141 | Q = |
| 142 | else |
| 143 | Q = @ |
| 144 | endif |
| 145 | |
Jiri Olsa | 6dd280c | 2015-01-10 21:43:32 +0100 | [diff] [blame] | 146 | # Do not use make's built-in rules |
| 147 | # (this improves performance and avoids hard-to-debug behaviour); |
| 148 | MAKEFLAGS += -r |
| 149 | |
Alexey Brodkin | 3c71ba3 | 2015-07-14 12:05:20 +0300 | [diff] [blame] | 150 | # Makefiles suck: This macro sets a default value of $(2) for the |
| 151 | # variable named by $(1), unless the variable has been set by |
| 152 | # environment or command line. This is necessary for CC and AR |
| 153 | # because make sets default values, so the simpler ?= approach |
| 154 | # won't work as expected. |
| 155 | define allow-override |
| 156 | $(if $(or $(findstring environment,$(origin $(1))),\ |
| 157 | $(findstring command line,$(origin $(1)))),,\ |
| 158 | $(eval $(1) = $(2))) |
| 159 | endef |
| 160 | |
Zubair Lutfullah Kakakhel | 37b4e20 | 2016-02-09 13:33:38 +0000 | [diff] [blame] | 161 | LD += $(EXTRA_LDFLAGS) |
| 162 | |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 163 | HOSTCC ?= gcc |
| 164 | HOSTLD ?= ld |
| 165 | HOSTAR ?= ar |
| 166 | |
Mark Rutland | a8a5cd8 | 2014-01-15 10:44:08 +0000 | [diff] [blame] | 167 | PKG_CONFIG = $(CROSS_COMPILE)pkg-config |
Wang Nan | d58ac0b | 2016-11-26 07:03:33 +0000 | [diff] [blame] | 168 | LLVM_CONFIG ?= llvm-config |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 169 | |
| 170 | RM = rm -f |
Arnaldo Carvalho de Melo | b52bc23 | 2013-09-24 11:56:36 -0300 | [diff] [blame] | 171 | LN = ln -f |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 172 | MKDIR = mkdir |
| 173 | FIND = find |
| 174 | INSTALL = install |
David Carrillo-Cisneros | 39a59f1 | 2017-08-27 00:54:38 -0700 | [diff] [blame] | 175 | FLEX ?= flex |
| 176 | BISON ?= bison |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 177 | STRIP = strip |
Adrian Hunter | 237fae7 | 2015-08-13 10:14:55 +0300 | [diff] [blame] | 178 | AWK = awk |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 179 | |
Jiri Olsa | 4842576 | 2016-08-01 20:02:33 +0200 | [diff] [blame] | 180 | # include Makefile.config by default and rule out |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 181 | # non-config cases |
| 182 | config := 1 |
| 183 | |
Jiri Olsa | 80f8735 | 2017-09-08 10:46:21 +0200 | [diff] [blame] | 184 | NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 185 | |
| 186 | ifdef MAKECMDGOALS |
| 187 | ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),) |
| 188 | config := 0 |
| 189 | endif |
| 190 | endif |
| 191 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 192 | # The fixdep build - we force fixdep tool to be built as |
| 193 | # the first target in the separate make session not to be |
| 194 | # disturbed by any parallel make jobs. Once fixdep is done |
| 195 | # we issue the requested build with FIXDEP=1 variable. |
| 196 | # |
| 197 | # The fixdep build is disabled for $(NON_CONFIG_TARGETS) |
| 198 | # targets, because it's not necessary. |
| 199 | |
| 200 | ifdef FIXDEP |
| 201 | force_fixdep := 0 |
| 202 | else |
| 203 | force_fixdep := $(config) |
| 204 | endif |
| 205 | |
| 206 | export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK |
| 207 | export HOSTCC HOSTLD HOSTAR |
| 208 | |
| 209 | include $(srctree)/tools/build/Makefile.include |
| 210 | |
| 211 | ifeq ($(force_fixdep),1) |
| 212 | goals := $(filter-out all sub-make, $(MAKECMDGOALS)) |
| 213 | |
| 214 | $(goals) all: sub-make |
| 215 | |
| 216 | sub-make: fixdep |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 217 | @./check-headers.sh |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 218 | $(Q)$(MAKE) FIXDEP=1 -f Makefile.perf $(goals) |
| 219 | |
| 220 | else # force_fixdep |
| 221 | |
Jiri Olsa | 8ac1eb7 | 2016-12-06 14:18:50 +0100 | [diff] [blame] | 222 | LIB_DIR = $(srctree)/tools/lib/api/ |
| 223 | TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ |
| 224 | BPF_DIR = $(srctree)/tools/lib/bpf/ |
| 225 | SUBCMD_DIR = $(srctree)/tools/lib/subcmd/ |
| 226 | |
Wang Nan | c053a15 | 2016-01-25 09:55:51 +0000 | [diff] [blame] | 227 | # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed. |
| 228 | # Without this setting the output feature dump file misses some features, for |
| 229 | # example, liberty. Select all checkers so we won't get an incomplete feature |
| 230 | # dump file. |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 231 | ifeq ($(config),1) |
Wang Nan | c053a15 | 2016-01-25 09:55:51 +0000 | [diff] [blame] | 232 | ifdef MAKECMDGOALS |
| 233 | ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump) |
| 234 | FEATURE_TESTS := all |
| 235 | endif |
| 236 | endif |
Jiri Olsa | 4842576 | 2016-08-01 20:02:33 +0200 | [diff] [blame] | 237 | include Makefile.config |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 238 | endif |
| 239 | |
Arnaldo Carvalho de Melo | 1b700c9 | 2016-04-04 19:05:36 -0300 | [diff] [blame] | 240 | ifeq ($(config),0) |
| 241 | include $(srctree)/tools/scripts/Makefile.arch |
Jiada Wang | 7a759cd | 2017-04-09 20:02:37 -0700 | [diff] [blame] | 242 | -include arch/$(SRCARCH)/Makefile |
Arnaldo Carvalho de Melo | 1b700c9 | 2016-04-04 19:05:36 -0300 | [diff] [blame] | 243 | endif |
| 244 | |
Jiri Olsa | 96b9e70 | 2016-01-15 04:00:18 +0000 | [diff] [blame] | 245 | # The FEATURE_DUMP_EXPORT holds location of the actual |
| 246 | # FEATURE_DUMP file to be used to bypass feature detection |
| 247 | # (for bpf or any other subproject) |
| 248 | ifeq ($(FEATURES_DUMP),) |
| 249 | FEATURE_DUMP_EXPORT := $(realpath $(OUTPUT)FEATURE-DUMP) |
| 250 | else |
David Carrillo-Cisneros | 70ff7c6 | 2017-08-27 00:54:42 -0700 | [diff] [blame] | 251 | FEATURE_DUMP_EXPORT := $(realpath $(FEATURES_DUMP)) |
Jiri Olsa | 96b9e70 | 2016-01-15 04:00:18 +0000 | [diff] [blame] | 252 | endif |
| 253 | |
Jiri Olsa | 3d7c014 | 2013-12-03 14:09:21 +0100 | [diff] [blame] | 254 | export prefix bindir sharedir sysconfdir DESTDIR |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 255 | |
| 256 | # sparse is architecture-neutral, which means that we need to tell it |
| 257 | # explicitly what architecture to check for. Fix this up for yours.. |
| 258 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
| 259 | |
| 260 | # Guard against environment variables |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 261 | PYRF_OBJS = |
| 262 | SCRIPT_SH = |
| 263 | |
| 264 | SCRIPT_SH += perf-archive.sh |
Adrian Hunter | c501e90 | 2014-07-31 09:01:12 +0300 | [diff] [blame] | 265 | SCRIPT_SH += perf-with-kcore.sh |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 266 | |
| 267 | grep-libs = $(filter -l%,$(1)) |
| 268 | strip-libs = $(filter-out -l%,$(1)) |
| 269 | |
| 270 | ifneq ($(OUTPUT),) |
| 271 | TE_PATH=$(OUTPUT) |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 272 | BPF_PATH=$(OUTPUT) |
Josh Poimboeuf | 4b6ab94 | 2015-12-15 09:39:39 -0600 | [diff] [blame] | 273 | SUBCMD_PATH=$(OUTPUT) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 274 | ifneq ($(subdir),) |
Josh Poimboeuf | 212e984 | 2015-12-13 22:18:06 -0600 | [diff] [blame] | 275 | API_PATH=$(OUTPUT)/../lib/api/ |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 276 | else |
Josh Poimboeuf | 212e984 | 2015-12-13 22:18:06 -0600 | [diff] [blame] | 277 | API_PATH=$(OUTPUT) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 278 | endif |
| 279 | else |
| 280 | TE_PATH=$(TRACE_EVENT_DIR) |
Josh Poimboeuf | 212e984 | 2015-12-13 22:18:06 -0600 | [diff] [blame] | 281 | API_PATH=$(LIB_DIR) |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 282 | BPF_PATH=$(BPF_DIR) |
Josh Poimboeuf | 4b6ab94 | 2015-12-15 09:39:39 -0600 | [diff] [blame] | 283 | SUBCMD_PATH=$(SUBCMD_DIR) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 284 | endif |
| 285 | |
| 286 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a |
| 287 | export LIBTRACEEVENT |
| 288 | |
He Kuang | e3d09ec | 2015-05-28 13:28:54 +0000 | [diff] [blame] | 289 | LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list |
Jiri Olsa | 6bd76b8 | 2017-08-25 15:45:10 -0300 | [diff] [blame] | 290 | |
| 291 | # |
| 292 | # The static build has no dynsym table, so this does not work for |
| 293 | # static build. Looks like linker starts to scream about that now |
| 294 | # (in Fedora 26) so we need to switch it off for static build. |
| 295 | DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST) |
| 296 | LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = $(if $(findstring -static,$(LDFLAGS)),,$(DYNAMIC_LIST_LDFLAGS)) |
He Kuang | e3d09ec | 2015-05-28 13:28:54 +0000 | [diff] [blame] | 297 | |
Josh Poimboeuf | 212e984 | 2015-12-13 22:18:06 -0600 | [diff] [blame] | 298 | LIBAPI = $(API_PATH)libapi.a |
Jiri Olsa | 285a8f2 | 2015-01-10 20:53:13 +0100 | [diff] [blame] | 299 | export LIBAPI |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 300 | |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 301 | LIBBPF = $(BPF_PATH)libbpf.a |
| 302 | |
Josh Poimboeuf | 4b6ab94 | 2015-12-15 09:39:39 -0600 | [diff] [blame] | 303 | LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a |
| 304 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 305 | # python extension build directories |
| 306 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ |
| 307 | PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/ |
| 308 | PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/ |
| 309 | export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP |
| 310 | |
Jaroslav Škarvada | 66dfdff | 2018-01-19 21:56:41 +0100 | [diff] [blame] | 311 | python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 312 | |
| 313 | PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) |
Jiri Olsa | 285a8f2 | 2015-01-10 20:53:13 +0100 | [diff] [blame] | 314 | PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 315 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 316 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) |
| 317 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 318 | PROGRAMS += $(OUTPUT)perf |
| 319 | |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 320 | ifndef NO_PERF_READ_VDSO32 |
| 321 | PROGRAMS += $(OUTPUT)perf-read-vdso32 |
| 322 | endif |
| 323 | |
| 324 | ifndef NO_PERF_READ_VDSOX32 |
| 325 | PROGRAMS += $(OUTPUT)perf-read-vdsox32 |
| 326 | endif |
| 327 | |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 328 | LIBJVMTI = libperf-jvmti.so |
| 329 | |
| 330 | ifndef NO_JVMTI |
| 331 | PROGRAMS += $(OUTPUT)$(LIBJVMTI) |
| 332 | endif |
| 333 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 334 | # what 'all' will build and 'install' will install, in perfexecdir |
| 335 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
| 336 | |
| 337 | # what 'all' will build but not install in perfexecdir |
| 338 | OTHER_PROGRAMS = $(OUTPUT)perf |
| 339 | |
| 340 | # Set paths to tools early so that they can be used for version tests. |
| 341 | ifndef SHELL_PATH |
| 342 | SHELL_PATH = /bin/sh |
| 343 | endif |
| 344 | ifndef PERL_PATH |
| 345 | PERL_PATH = /usr/bin/perl |
| 346 | endif |
| 347 | |
| 348 | export PERL_PATH |
| 349 | |
Jiri Olsa | 6368942 | 2019-02-13 13:32:38 +0100 | [diff] [blame] | 350 | LIBPERF_A=$(OUTPUT)libperf.a |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 351 | |
Jiri Olsa | d0bfbed | 2019-02-13 13:32:37 +0100 | [diff] [blame] | 352 | PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 353 | ifndef NO_LIBBPF |
| 354 | PERFLIBS += $(LIBBPF) |
| 355 | endif |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 356 | |
| 357 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 358 | # because maintaining the nesting to match is a pain. If |
| 359 | # we had "elif" things would have been much nicer... |
| 360 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 361 | ifneq ($(OUTPUT),) |
| 362 | CFLAGS += -I$(OUTPUT) |
| 363 | endif |
| 364 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 365 | ifndef NO_GTK2 |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 366 | ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so |
Jiri Olsa | 88aeea0 | 2014-12-30 00:34:23 +0100 | [diff] [blame] | 367 | GTK_IN := $(OUTPUT)gtk-in.o |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 368 | endif |
| 369 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 370 | ifdef ASCIIDOC8 |
| 371 | export ASCIIDOC8 |
| 372 | endif |
| 373 | |
David Carrillo-Cisneros | cb281fe | 2017-07-18 18:18:37 -0700 | [diff] [blame] | 374 | EXTLIBS := $(call filter-out,$(EXCLUDE_EXTLIBS),$(EXTLIBS)) |
| 375 | LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 376 | |
Wang Nan | d58ac0b | 2016-11-26 07:03:33 +0000 | [diff] [blame] | 377 | ifeq ($(USE_CLANG), 1) |
| 378 | CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization |
Sandipan Das | c2fb54a | 2018-04-04 23:34:17 +0530 | [diff] [blame] | 379 | CLANGLIBS_NOEXT_LIST = $(foreach l,$(CLANGLIBS_LIST),$(shell $(LLVM_CONFIG) --libdir)/libclang$(l)) |
| 380 | LIBCLANG = $(foreach l,$(CLANGLIBS_NOEXT_LIST),$(wildcard $(l).a $(l).so)) |
Wang Nan | d58ac0b | 2016-11-26 07:03:33 +0000 | [diff] [blame] | 381 | LIBS += -Wl,--start-group $(LIBCLANG) -Wl,--end-group |
| 382 | endif |
| 383 | |
| 384 | ifeq ($(USE_LLVM), 1) |
| 385 | LIBLLVM = $(shell $(LLVM_CONFIG) --libs all) $(shell $(LLVM_CONFIG) --system-libs) |
| 386 | LIBS += -L$(shell $(LLVM_CONFIG) --libdir) $(LIBLLVM) |
| 387 | endif |
| 388 | |
| 389 | ifeq ($(USE_CXX), 1) |
| 390 | LIBS += -lstdc++ |
| 391 | endif |
| 392 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 393 | export INSTALL SHELL_PATH |
| 394 | |
| 395 | ### Build rules |
| 396 | |
| 397 | SHELL = $(SHELL_PATH) |
| 398 | |
Arnaldo Carvalho de Melo | 03aeb6c | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 399 | linux_uapi_dir := $(srctree)/tools/include/uapi/linux |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 400 | asm_generic_uapi_dir := $(srctree)/tools/include/uapi/asm-generic |
Arnaldo Carvalho de Melo | e2c39f3 | 2018-11-05 15:46:51 -0300 | [diff] [blame] | 401 | arch_asm_uapi_dir := $(srctree)/tools/arch/$(SRCARCH)/include/uapi/asm/ |
Arnaldo Carvalho de Melo | 40714e8 | 2018-12-17 17:00:14 -0300 | [diff] [blame] | 402 | x86_arch_asm_uapi_dir := $(srctree)/tools/arch/x86/include/uapi/asm/ |
Arnaldo Carvalho de Melo | 03aeb6c | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 403 | |
Arnaldo Carvalho de Melo | 83bc9c37 | 2017-08-28 11:47:11 -0300 | [diff] [blame] | 404 | beauty_outdir := $(OUTPUT)trace/beauty/generated |
| 405 | beauty_ioctl_outdir := $(beauty_outdir)/ioctl |
Arnaldo Carvalho de Melo | 2c3e962 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 406 | drm_ioctl_array := $(beauty_ioctl_outdir)/drm_ioctl_array.c |
Arnaldo Carvalho de Melo | ef9811f | 2017-07-31 16:47:37 -0300 | [diff] [blame] | 407 | drm_hdr_dir := $(srctree)/tools/include/uapi/drm |
| 408 | drm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/drm_ioctl.sh |
| 409 | |
| 410 | # Create output directory if not already present |
Arnaldo Carvalho de Melo | 2c3e962 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 411 | _dummy := $(shell [ -d '$(beauty_ioctl_outdir)' ] || mkdir -p '$(beauty_ioctl_outdir)') |
Arnaldo Carvalho de Melo | ef9811f | 2017-07-31 16:47:37 -0300 | [diff] [blame] | 412 | |
| 413 | $(drm_ioctl_array): $(drm_hdr_dir)/drm.h $(drm_hdr_dir)/i915_drm.h $(drm_ioctl_tbl) |
| 414 | $(Q)$(SHELL) '$(drm_ioctl_tbl)' $(drm_hdr_dir) > $@ |
| 415 | |
Arnaldo Carvalho de Melo | 42337cb | 2018-12-18 11:54:31 -0300 | [diff] [blame] | 416 | fadvise_advice_array := $(beauty_outdir)/fadvise_advice_array.c |
| 417 | fadvise_advice_tbl := $(srctree)/tools/perf/trace/beauty/fadvise.sh |
| 418 | |
| 419 | $(fadvise_advice_array): $(linux_uapi_dir)/in.h $(fadvise_advice_tbl) |
| 420 | $(Q)$(SHELL) '$(fadvise_advice_tbl)' $(linux_uapi_dir) > $@ |
| 421 | |
Arnaldo Carvalho de Melo | f6af095 | 2019-05-21 16:34:03 -0300 | [diff] [blame^] | 422 | fsmount_arrays := $(beauty_outdir)/fsmount_arrays.c |
| 423 | fsmount_tbls := $(srctree)/tools/perf/trace/beauty/fsmount.sh |
| 424 | |
| 425 | $(fsmount_arrays): $(linux_uapi_dir)/fs.h $(fsmount_tbls) |
| 426 | $(Q)$(SHELL) '$(fsmount_tbls)' $(linux_uapi_dir) > $@ |
| 427 | |
Arnaldo Carvalho de Melo | 693bd39 | 2019-05-20 16:24:15 -0300 | [diff] [blame] | 428 | fspick_arrays := $(beauty_outdir)/fspick_arrays.c |
| 429 | fspick_tbls := $(srctree)/tools/perf/trace/beauty/fspick.sh |
| 430 | |
| 431 | $(fspick_arrays): $(linux_uapi_dir)/fs.h $(fspick_tbls) |
| 432 | $(Q)$(SHELL) '$(fspick_tbls)' $(linux_uapi_dir) > $@ |
| 433 | |
Arnaldo Carvalho de Melo | dcc6fd6 | 2019-05-21 15:36:44 -0300 | [diff] [blame] | 434 | fsconfig_arrays := $(beauty_outdir)/fsconfig_arrays.c |
| 435 | fsconfig_tbls := $(srctree)/tools/perf/trace/beauty/fsconfig.sh |
| 436 | |
| 437 | $(fsconfig_arrays): $(linux_uapi_dir)/fs.h $(fsconfig_tbls) |
| 438 | $(Q)$(SHELL) '$(fsconfig_tbls)' $(linux_uapi_dir) > $@ |
| 439 | |
Arnaldo Carvalho de Melo | 83bc9c37 | 2017-08-28 11:47:11 -0300 | [diff] [blame] | 440 | pkey_alloc_access_rights_array := $(beauty_outdir)/pkey_alloc_access_rights_array.c |
| 441 | asm_generic_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/ |
| 442 | pkey_alloc_access_rights_tbl := $(srctree)/tools/perf/trace/beauty/pkey_alloc_access_rights.sh |
| 443 | |
| 444 | $(pkey_alloc_access_rights_array): $(asm_generic_hdr_dir)/mman-common.h $(pkey_alloc_access_rights_tbl) |
| 445 | $(Q)$(SHELL) '$(pkey_alloc_access_rights_tbl)' $(asm_generic_hdr_dir) > $@ |
| 446 | |
Arnaldo Carvalho de Melo | 2c3e962 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 447 | sndrv_ctl_ioctl_array := $(beauty_ioctl_outdir)/sndrv_ctl_ioctl_array.c |
| 448 | sndrv_ctl_hdr_dir := $(srctree)/tools/include/uapi/sound |
| 449 | sndrv_ctl_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh |
| 450 | |
| 451 | $(sndrv_ctl_ioctl_array): $(sndrv_ctl_hdr_dir)/asound.h $(sndrv_ctl_ioctl_tbl) |
| 452 | $(Q)$(SHELL) '$(sndrv_ctl_ioctl_tbl)' $(sndrv_ctl_hdr_dir) > $@ |
| 453 | |
| 454 | sndrv_pcm_ioctl_array := $(beauty_ioctl_outdir)/sndrv_pcm_ioctl_array.c |
| 455 | sndrv_pcm_hdr_dir := $(srctree)/tools/include/uapi/sound |
| 456 | sndrv_pcm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh |
| 457 | |
| 458 | $(sndrv_pcm_ioctl_array): $(sndrv_pcm_hdr_dir)/asound.h $(sndrv_pcm_ioctl_tbl) |
| 459 | $(Q)$(SHELL) '$(sndrv_pcm_ioctl_tbl)' $(sndrv_pcm_hdr_dir) > $@ |
| 460 | |
Arnaldo Carvalho de Melo | 1de3038 | 2017-10-31 11:32:23 -0300 | [diff] [blame] | 461 | kcmp_type_array := $(beauty_outdir)/kcmp_type_array.c |
| 462 | kcmp_hdr_dir := $(srctree)/tools/include/uapi/linux/ |
| 463 | kcmp_type_tbl := $(srctree)/tools/perf/trace/beauty/kcmp_type.sh |
| 464 | |
| 465 | $(kcmp_type_array): $(kcmp_hdr_dir)/kcmp.h $(kcmp_type_tbl) |
| 466 | $(Q)$(SHELL) '$(kcmp_type_tbl)' $(kcmp_hdr_dir) > $@ |
| 467 | |
Arnaldo Carvalho de Melo | 45717b7 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 468 | kvm_ioctl_array := $(beauty_ioctl_outdir)/kvm_ioctl_array.c |
| 469 | kvm_hdr_dir := $(srctree)/tools/include/uapi/linux |
| 470 | kvm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/kvm_ioctl.sh |
| 471 | |
| 472 | $(kvm_ioctl_array): $(kvm_hdr_dir)/kvm.h $(kvm_ioctl_tbl) |
| 473 | $(Q)$(SHELL) '$(kvm_ioctl_tbl)' $(kvm_hdr_dir) > $@ |
| 474 | |
Arnaldo Carvalho de Melo | 03aeb6c | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 475 | socket_ipproto_array := $(beauty_outdir)/socket_ipproto_array.c |
| 476 | socket_ipproto_tbl := $(srctree)/tools/perf/trace/beauty/socket_ipproto.sh |
| 477 | |
| 478 | $(socket_ipproto_array): $(linux_uapi_dir)/in.h $(socket_ipproto_tbl) |
| 479 | $(Q)$(SHELL) '$(socket_ipproto_tbl)' $(linux_uapi_dir) > $@ |
| 480 | |
Arnaldo Carvalho de Melo | ec6dd85 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 481 | vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c |
| 482 | vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux |
| 483 | vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh |
| 484 | |
| 485 | $(vhost_virtio_ioctl_array): $(vhost_virtio_hdr_dir)/vhost.h $(vhost_virtio_ioctl_tbl) |
| 486 | $(Q)$(SHELL) '$(vhost_virtio_ioctl_tbl)' $(vhost_virtio_hdr_dir) > $@ |
| 487 | |
Arnaldo Carvalho de Melo | 81e3d8b | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 488 | perf_ioctl_array := $(beauty_ioctl_outdir)/perf_ioctl_array.c |
| 489 | perf_hdr_dir := $(srctree)/tools/include/uapi/linux |
| 490 | perf_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/perf_ioctl.sh |
| 491 | |
| 492 | $(perf_ioctl_array): $(perf_hdr_dir)/perf_event.h $(perf_ioctl_tbl) |
| 493 | $(Q)$(SHELL) '$(perf_ioctl_tbl)' $(perf_hdr_dir) > $@ |
| 494 | |
Arnaldo Carvalho de Melo | 5a54c2f | 2017-09-20 12:30:36 -0300 | [diff] [blame] | 495 | madvise_behavior_array := $(beauty_outdir)/madvise_behavior_array.c |
| 496 | madvise_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/ |
| 497 | madvise_behavior_tbl := $(srctree)/tools/perf/trace/beauty/madvise_behavior.sh |
| 498 | |
| 499 | $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl) |
| 500 | $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@ |
| 501 | |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 502 | mmap_flags_array := $(beauty_outdir)/mmap_flags_array.c |
| 503 | mmap_flags_tbl := $(srctree)/tools/perf/trace/beauty/mmap_flags.sh |
| 504 | |
Arnaldo Carvalho de Melo | be709d4 | 2019-03-25 14:06:07 -0300 | [diff] [blame] | 505 | $(mmap_flags_array): $(linux_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman-common.h $(mmap_flags_tbl) |
| 506 | $(Q)$(SHELL) '$(mmap_flags_tbl)' $(linux_uapi_dir) $(asm_generic_uapi_dir) $(arch_asm_uapi_dir) > $@ |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 507 | |
Arnaldo Carvalho de Melo | 73d141a | 2018-10-25 15:18:06 -0300 | [diff] [blame] | 508 | mount_flags_array := $(beauty_outdir)/mount_flags_array.c |
| 509 | mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/mount_flags.sh |
| 510 | |
| 511 | $(mount_flags_array): $(linux_uapi_dir)/fs.h $(mount_flags_tbl) |
| 512 | $(Q)$(SHELL) '$(mount_flags_tbl)' $(linux_uapi_dir) > $@ |
| 513 | |
Arnaldo Carvalho de Melo | 566e302 | 2019-05-20 14:58:03 -0300 | [diff] [blame] | 514 | move_mount_flags_array := $(beauty_outdir)/move_mount_flags_array.c |
| 515 | move_mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/move_mount_flags.sh |
| 516 | |
| 517 | $(move_mount_flags_array): $(linux_uapi_dir)/fs.h $(move_mount_flags_tbl) |
| 518 | $(Q)$(SHELL) '$(move_mount_flags_tbl)' $(linux_uapi_dir) > $@ |
| 519 | |
Arnaldo Carvalho de Melo | d688d03 | 2017-10-26 15:19:35 -0300 | [diff] [blame] | 520 | prctl_option_array := $(beauty_outdir)/prctl_option_array.c |
| 521 | prctl_hdr_dir := $(srctree)/tools/include/uapi/linux/ |
| 522 | prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh |
| 523 | |
| 524 | $(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl) |
| 525 | $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@ |
| 526 | |
Arnaldo Carvalho de Melo | 86cf4c6 | 2018-12-27 15:10:34 -0300 | [diff] [blame] | 527 | usbdevfs_ioctl_array := $(beauty_ioctl_outdir)/usbdevfs_ioctl_array.c |
| 528 | usbdevfs_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/usbdevfs_ioctl.sh |
| 529 | |
| 530 | $(usbdevfs_ioctl_array): $(linux_uapi_dir)/usbdevice_fs.h $(usbdevfs_ioctl_tbl) |
| 531 | $(Q)$(SHELL) '$(usbdevfs_ioctl_tbl)' $(linux_uapi_dir) > $@ |
| 532 | |
Arnaldo Carvalho de Melo | 40714e8 | 2018-12-17 17:00:14 -0300 | [diff] [blame] | 533 | x86_arch_prctl_code_array := $(beauty_outdir)/x86_arch_prctl_code_array.c |
| 534 | x86_arch_prctl_code_tbl := $(srctree)/tools/perf/trace/beauty/x86_arch_prctl.sh |
| 535 | |
| 536 | $(x86_arch_prctl_code_array): $(x86_arch_asm_uapi_dir)/prctl.h $(x86_arch_prctl_code_tbl) |
| 537 | $(Q)$(SHELL) '$(x86_arch_prctl_code_tbl)' $(x86_arch_asm_uapi_dir) > $@ |
| 538 | |
Arnaldo Carvalho de Melo | 5a1cb7e | 2018-12-11 10:26:13 -0300 | [diff] [blame] | 539 | rename_flags_array := $(beauty_outdir)/rename_flags_array.c |
| 540 | rename_flags_tbl := $(srctree)/tools/perf/trace/beauty/rename_flags.sh |
| 541 | |
| 542 | $(rename_flags_array): $(linux_uapi_dir)/fs.h $(rename_flags_tbl) |
| 543 | $(Q)$(SHELL) '$(rename_flags_tbl)' $(linux_uapi_dir) > $@ |
| 544 | |
Hendrik Brueckner | 0337cf7 | 2018-01-19 09:56:15 +0100 | [diff] [blame] | 545 | arch_errno_name_array := $(beauty_outdir)/arch_errno_name_array.c |
| 546 | arch_errno_hdr_dir := $(srctree)/tools |
| 547 | arch_errno_tbl := $(srctree)/tools/perf/trace/beauty/arch_errno_names.sh |
| 548 | |
| 549 | $(arch_errno_name_array): $(arch_errno_tbl) |
| 550 | $(Q)$(SHELL) '$(arch_errno_tbl)' $(CC) $(arch_errno_hdr_dir) > $@ |
| 551 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 552 | all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) |
| 553 | |
Arnaldo Carvalho de Melo | f712a86 | 2019-01-03 16:03:46 -0300 | [diff] [blame] | 554 | # Create python binding output directory if not already present |
| 555 | _dummy := $(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python') |
| 556 | |
Jiri Olsa | 0b4d4b0 | 2016-12-04 21:42:55 +0100 | [diff] [blame] | 557 | $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) |
| 558 | $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \ |
| 559 | CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \ |
| 560 | $(PYTHON_WORD) util/setup.py \ |
| 561 | --quiet build_ext; \ |
Jaroslav Škarvada | 66dfdff | 2018-01-19 21:56:41 +0100 | [diff] [blame] | 562 | cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/ |
Jiri Olsa | 0b4d4b0 | 2016-12-04 21:42:55 +0100 | [diff] [blame] | 563 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 564 | please_set_SHELL_PATH_to_a_more_modern_shell: |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 565 | $(Q)$$(:) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 566 | |
| 567 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell |
| 568 | |
| 569 | strip: $(PROGRAMS) $(OUTPUT)perf |
| 570 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf |
| 571 | |
Jiri Olsa | 72965b8 | 2014-12-29 13:52:36 +0100 | [diff] [blame] | 572 | PERF_IN := $(OUTPUT)perf-in.o |
| 573 | |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 574 | JEVENTS := $(OUTPUT)pmu-events/jevents |
| 575 | JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o |
| 576 | |
| 577 | PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o |
| 578 | |
Jiri Olsa | d0bfbed | 2019-02-13 13:32:37 +0100 | [diff] [blame] | 579 | LIBPERF_IN := $(OUTPUT)libperf-in.o |
| 580 | |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 581 | export JEVENTS |
| 582 | |
| 583 | build := -f $(srctree)/tools/build/Makefile.build dir=. obj |
| 584 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 585 | $(PERF_IN): prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 586 | $(Q)$(MAKE) $(build)=perf |
Jiri Olsa | 72965b8 | 2014-12-29 13:52:36 +0100 | [diff] [blame] | 587 | |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 588 | $(JEVENTS_IN): FORCE |
| 589 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=jevents |
| 590 | |
| 591 | $(JEVENTS): $(JEVENTS_IN) |
| 592 | $(QUIET_LINK)$(HOSTCC) $(JEVENTS_IN) -o $@ |
| 593 | |
| 594 | $(PMU_EVENTS_IN): $(JEVENTS) FORCE |
| 595 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events |
| 596 | |
Jiri Olsa | d0bfbed | 2019-02-13 13:32:37 +0100 | [diff] [blame] | 597 | $(LIBPERF_IN): prepare FORCE |
| 598 | $(Q)$(MAKE) $(build)=libperf |
| 599 | |
| 600 | $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) |
Wang Nan | 5d61832 | 2015-06-17 14:46:29 +0000 | [diff] [blame] | 601 | $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \ |
Jiri Olsa | d0bfbed | 2019-02-13 13:32:37 +0100 | [diff] [blame] | 602 | $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@ |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 603 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 604 | $(GTK_IN): FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 605 | $(Q)$(MAKE) $(build)=gtk |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 606 | |
Jiri Olsa | 88aeea0 | 2014-12-30 00:34:23 +0100 | [diff] [blame] | 607 | $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS) |
Jiri Olsa | e27a08f | 2014-04-27 11:12:21 +0200 | [diff] [blame] | 608 | $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS) |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 609 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 610 | $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt |
| 611 | |
| 612 | $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt) |
| 613 | $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@ |
| 614 | |
| 615 | $(SCRIPTS) : % : %.sh |
| 616 | $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@' |
| 617 | |
Jiri Olsa | 16e2ef4 | 2016-12-06 14:18:48 +0100 | [diff] [blame] | 618 | $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD |
| 619 | $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
| 620 | $(Q)touch $(OUTPUT)PERF-VERSION-FILE |
| 621 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 622 | # These can record PERF_VERSION |
Jiri Olsa | cb4e67f | 2014-12-30 17:09:15 +0100 | [diff] [blame] | 623 | perf.spec $(SCRIPTS) \ |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 624 | : $(OUTPUT)PERF-VERSION-FILE |
| 625 | |
| 626 | .SUFFIXES: |
Ingo Molnar | 1f7c645 | 2013-10-04 12:14:59 +0200 | [diff] [blame] | 627 | |
| 628 | # |
| 629 | # If a target does not match any of the later rules then prefix it by $(OUTPUT) |
| 630 | # This makes targets like 'make O=/tmp/perf perf.o' work in a natural way. |
| 631 | # |
| 632 | ifneq ($(OUTPUT),) |
| 633 | %.o: $(OUTPUT)%.o |
| 634 | @echo " # Redirected target $@ => $(OUTPUT)$@" |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 635 | pmu-events/%.o: $(OUTPUT)pmu-events/%.o |
| 636 | @echo " # Redirected target $@ => $(OUTPUT)$@" |
Ingo Molnar | 1f7c645 | 2013-10-04 12:14:59 +0200 | [diff] [blame] | 637 | util/%.o: $(OUTPUT)util/%.o |
Ingo Molnar | cee972c | 2013-10-10 07:42:56 +0200 | [diff] [blame] | 638 | @echo " # Redirected target $@ => $(OUTPUT)$@" |
Ingo Molnar | 1f7c645 | 2013-10-04 12:14:59 +0200 | [diff] [blame] | 639 | bench/%.o: $(OUTPUT)bench/%.o |
Ingo Molnar | cee972c | 2013-10-10 07:42:56 +0200 | [diff] [blame] | 640 | @echo " # Redirected target $@ => $(OUTPUT)$@" |
Ingo Molnar | 1f7c645 | 2013-10-04 12:14:59 +0200 | [diff] [blame] | 641 | tests/%.o: $(OUTPUT)tests/%.o |
Ingo Molnar | cee972c | 2013-10-10 07:42:56 +0200 | [diff] [blame] | 642 | @echo " # Redirected target $@ => $(OUTPUT)$@" |
Ingo Molnar | 1f7c645 | 2013-10-04 12:14:59 +0200 | [diff] [blame] | 643 | endif |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 644 | |
| 645 | # These two need to be here so that when O= is not used they take precedence |
| 646 | # over the general rule for .o |
| 647 | |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 648 | # get relative building directory (to $(OUTPUT)) |
| 649 | # and '.' if it's $(OUTPUT) itself |
| 650 | __build-dir = $(subst $(OUTPUT),,$(dir $@)) |
| 651 | build-dir = $(if $(__build-dir),$(__build-dir),.) |
| 652 | |
Arnaldo Carvalho de Melo | 45717b7 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 653 | prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioctl_array) \ |
Arnaldo Carvalho de Melo | 42337cb | 2018-12-18 11:54:31 -0300 | [diff] [blame] | 654 | $(fadvise_advice_array) \ |
Arnaldo Carvalho de Melo | dcc6fd6 | 2019-05-21 15:36:44 -0300 | [diff] [blame] | 655 | $(fsconfig_arrays) \ |
Arnaldo Carvalho de Melo | f6af095 | 2019-05-21 16:34:03 -0300 | [diff] [blame^] | 656 | $(fsmount_arrays) \ |
Arnaldo Carvalho de Melo | 693bd39 | 2019-05-20 16:24:15 -0300 | [diff] [blame] | 657 | $(fspick_arrays) \ |
Arnaldo Carvalho de Melo | 83bc9c37 | 2017-08-28 11:47:11 -0300 | [diff] [blame] | 658 | $(pkey_alloc_access_rights_array) \ |
Arnaldo Carvalho de Melo | 45717b7 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 659 | $(sndrv_pcm_ioctl_array) \ |
| 660 | $(sndrv_ctl_ioctl_array) \ |
Arnaldo Carvalho de Melo | 1de3038 | 2017-10-31 11:32:23 -0300 | [diff] [blame] | 661 | $(kcmp_type_array) \ |
Arnaldo Carvalho de Melo | ec6dd85 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 662 | $(kvm_ioctl_array) \ |
Arnaldo Carvalho de Melo | 03aeb6c | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 663 | $(socket_ipproto_array) \ |
Arnaldo Carvalho de Melo | 81e3d8b | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 664 | $(vhost_virtio_ioctl_array) \ |
Arnaldo Carvalho de Melo | 5a54c2f | 2017-09-20 12:30:36 -0300 | [diff] [blame] | 665 | $(madvise_behavior_array) \ |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 666 | $(mmap_flags_array) \ |
Arnaldo Carvalho de Melo | 73d141a | 2018-10-25 15:18:06 -0300 | [diff] [blame] | 667 | $(mount_flags_array) \ |
Arnaldo Carvalho de Melo | 566e302 | 2019-05-20 14:58:03 -0300 | [diff] [blame] | 668 | $(move_mount_flags_array) \ |
Arnaldo Carvalho de Melo | d688d03 | 2017-10-26 15:19:35 -0300 | [diff] [blame] | 669 | $(perf_ioctl_array) \ |
Hendrik Brueckner | 0337cf7 | 2018-01-19 09:56:15 +0100 | [diff] [blame] | 670 | $(prctl_option_array) \ |
Arnaldo Carvalho de Melo | 86cf4c6 | 2018-12-27 15:10:34 -0300 | [diff] [blame] | 671 | $(usbdevfs_ioctl_array) \ |
Arnaldo Carvalho de Melo | 40714e8 | 2018-12-17 17:00:14 -0300 | [diff] [blame] | 672 | $(x86_arch_prctl_code_array) \ |
Arnaldo Carvalho de Melo | 5a1cb7e | 2018-12-11 10:26:13 -0300 | [diff] [blame] | 673 | $(rename_flags_array) \ |
Hendrik Brueckner | 0337cf7 | 2018-01-19 09:56:15 +0100 | [diff] [blame] | 674 | $(arch_errno_name_array) |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 675 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 676 | $(OUTPUT)%.o: %.c prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 677 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 678 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 679 | $(OUTPUT)%.i: %.c prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 680 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 681 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 682 | $(OUTPUT)%.s: %.c prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 683 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 684 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 685 | $(OUTPUT)%-bison.o: %.c prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 686 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 687 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 688 | $(OUTPUT)%-flex.o: %.c prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 689 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 690 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 691 | $(OUTPUT)%.o: %.S prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 692 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Jiri Olsa | 1999307 | 2014-12-30 18:44:38 +0100 | [diff] [blame] | 693 | |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 694 | $(OUTPUT)%.i: %.S prepare FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 695 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 696 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 697 | $(OUTPUT)perf-%: %.o $(PERFLIBS) |
| 698 | $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 699 | |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 700 | ifndef NO_PERF_READ_VDSO32 |
Florian Fainelli | 0115323 | 2018-12-20 19:43:36 -0800 | [diff] [blame] | 701 | $(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-map.c |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 702 | $(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c |
| 703 | endif |
| 704 | |
| 705 | ifndef NO_PERF_READ_VDSOX32 |
Florian Fainelli | 0115323 | 2018-12-20 19:43:36 -0800 | [diff] [blame] | 706 | $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-map.c |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 707 | $(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c |
| 708 | endif |
| 709 | |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 710 | ifndef NO_JVMTI |
| 711 | LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o |
| 712 | |
| 713 | $(LIBJVMTI_IN): FORCE |
| 714 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti |
| 715 | |
| 716 | $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN) |
Jiri Olsa | 3f64393 | 2018-12-12 14:29:40 +0100 | [diff] [blame] | 717 | $(QUIET_LINK)$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 718 | endif |
| 719 | |
Jiri Olsa | 8e499ac | 2014-12-30 16:51:35 +0100 | [diff] [blame] | 720 | $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 721 | |
Jiri Olsa | 6368942 | 2019-02-13 13:32:38 +0100 | [diff] [blame] | 722 | $(LIBPERF_A): $(LIBPERF_IN) |
Jiri Olsa | 9352aab | 2014-12-29 17:42:46 +0100 | [diff] [blame] | 723 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 724 | |
Jiri Olsa | 298faf5 | 2018-10-16 17:06:07 +0200 | [diff] [blame] | 725 | LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
Jiri Olsa | 3d7c014 | 2013-12-03 14:09:21 +0100 | [diff] [blame] | 726 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 727 | $(LIBTRACEEVENT): FORCE |
He Kuang | e3d09ec | 2015-05-28 13:28:54 +0000 | [diff] [blame] | 728 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a |
| 729 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 730 | libtraceevent_plugins: FORCE |
He Kuang | e3d09ec | 2015-05-28 13:28:54 +0000 | [diff] [blame] | 731 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins |
| 732 | |
| 733 | $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins |
| 734 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 735 | |
| 736 | $(LIBTRACEEVENT)-clean: |
Ingo Molnar | 8ec19c0 | 2013-10-09 11:49:26 +0200 | [diff] [blame] | 737 | $(call QUIET_CLEAN, libtraceevent) |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 738 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 739 | |
Jiri Olsa | 67befc6 | 2015-11-26 14:54:04 +0100 | [diff] [blame] | 740 | install-traceevent-plugins: libtraceevent_plugins |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 741 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins |
Jiri Olsa | 3d7c014 | 2013-12-03 14:09:21 +0100 | [diff] [blame] | 742 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 743 | $(LIBAPI): FORCE |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 744 | $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 745 | |
Jiri Olsa | 285a8f2 | 2015-01-10 20:53:13 +0100 | [diff] [blame] | 746 | $(LIBAPI)-clean: |
| 747 | $(call QUIET_CLEAN, libapi) |
Jiri Olsa | ceed252 | 2015-01-11 23:59:55 +0100 | [diff] [blame] | 748 | $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 749 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 750 | $(LIBBPF): FORCE |
Jiri Olsa | 96b9e70 | 2016-01-15 04:00:18 +0000 | [diff] [blame] | 751 | $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) |
Wang Nan | ed63f34c | 2015-10-14 12:41:12 +0000 | [diff] [blame] | 752 | |
| 753 | $(LIBBPF)-clean: |
| 754 | $(call QUIET_CLEAN, libbpf) |
| 755 | $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null |
| 756 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 757 | $(LIBSUBCMD): FORCE |
Josh Poimboeuf | 4b6ab94 | 2015-12-15 09:39:39 -0600 | [diff] [blame] | 758 | $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a |
| 759 | |
| 760 | $(LIBSUBCMD)-clean: |
| 761 | $(call QUIET_CLEAN, libsubcmd) |
| 762 | $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) clean |
| 763 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 764 | help: |
| 765 | @echo 'Perf make targets:' |
| 766 | @echo ' doc - make *all* documentation (see below)' |
| 767 | @echo ' man - make manpage documentation (access with man <foo>)' |
| 768 | @echo ' html - make html documentation' |
| 769 | @echo ' info - make GNU info documentation (access with info <foo>)' |
| 770 | @echo ' pdf - make pdf documentation' |
| 771 | @echo ' TAGS - use etags to make tag information for source browsing' |
| 772 | @echo ' tags - use ctags to make tag information for source browsing' |
| 773 | @echo ' cscope - use cscope to make interactive browsing database' |
| 774 | @echo '' |
| 775 | @echo 'Perf install targets:' |
| 776 | @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed' |
Jianyu Zhan | fc9cabe | 2014-06-03 00:44:34 +0800 | [diff] [blame] | 777 | @echo ' HINT: use "prefix" or "DESTDIR" to install to a particular' |
| 778 | @echo ' path like "make prefix=/usr/local install install-doc"' |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 779 | @echo ' install - install compiled binaries' |
| 780 | @echo ' install-doc - install *all* documentation' |
| 781 | @echo ' install-man - install manpage documentation' |
| 782 | @echo ' install-html - install html documentation' |
| 783 | @echo ' install-info - install GNU info documentation' |
| 784 | @echo ' install-pdf - install pdf documentation' |
| 785 | @echo '' |
| 786 | @echo ' quick-install-doc - alias for quick-install-man' |
| 787 | @echo ' quick-install-man - install the documentation quickly' |
| 788 | @echo ' quick-install-html - install the html documentation quickly' |
| 789 | @echo '' |
| 790 | @echo 'Perf maintainer targets:' |
| 791 | @echo ' clean - clean all binary objects and build output' |
| 792 | |
| 793 | |
| 794 | DOC_TARGETS := doc man html info pdf |
| 795 | |
| 796 | INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man |
| 797 | INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html |
| 798 | |
| 799 | # 'make doc' should call 'make -C Documentation all' |
| 800 | $(DOC_TARGETS): |
| 801 | $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all) |
| 802 | |
Jiri Olsa | 685c841 | 2016-01-07 10:14:06 +0100 | [diff] [blame] | 803 | TAG_FOLDERS= . ../lib ../include |
Sebastian Andrzej Siewior | 16a6433 | 2014-05-28 10:19:18 +0200 | [diff] [blame] | 804 | TAG_FILES= ../../include/uapi/linux/perf_event.h |
| 805 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 806 | TAGS: |
Jiri Olsa | b0815d0 | 2014-06-04 14:43:58 +0200 | [diff] [blame] | 807 | $(QUIET_GEN)$(RM) TAGS; \ |
Jiri Olsa | ed39562 | 2018-03-07 16:50:17 +0100 | [diff] [blame] | 808 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs etags -a $(TAG_FILES) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 809 | |
| 810 | tags: |
Jiri Olsa | b0815d0 | 2014-06-04 14:43:58 +0200 | [diff] [blame] | 811 | $(QUIET_GEN)$(RM) tags; \ |
Jiri Olsa | ed39562 | 2018-03-07 16:50:17 +0100 | [diff] [blame] | 812 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs ctags -a $(TAG_FILES) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 813 | |
| 814 | cscope: |
Jiri Olsa | b0815d0 | 2014-06-04 14:43:58 +0200 | [diff] [blame] | 815 | $(QUIET_GEN)$(RM) cscope*; \ |
Jiri Olsa | ed39562 | 2018-03-07 16:50:17 +0100 | [diff] [blame] | 816 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs cscope -b $(TAG_FILES) |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 817 | |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 818 | ### Testing rules |
| 819 | |
| 820 | # GNU make supports exporting all variables by "export" without parameters. |
| 821 | # However, the environment gets quite big, and some programs have problems |
| 822 | # with that. |
| 823 | |
| 824 | check: $(OUTPUT)common-cmds.h |
| 825 | if sparse; \ |
| 826 | then \ |
| 827 | for i in *.c */*.c; \ |
| 828 | do \ |
| 829 | sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \ |
| 830 | done; \ |
| 831 | else \ |
| 832 | exit 1; \ |
| 833 | fi |
| 834 | |
| 835 | ### Installation rules |
| 836 | |
Jiri Olsa | 5c319a6 | 2016-12-04 21:42:54 +0100 | [diff] [blame] | 837 | ifndef NO_GTK2 |
| 838 | install-gtk: $(OUTPUT)libperf-gtk.so |
| 839 | $(call QUIET_INSTALL, 'GTK UI') \ |
| 840 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \ |
| 841 | $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)' |
| 842 | else |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 843 | install-gtk: |
Jiri Olsa | 5c319a6 | 2016-12-04 21:42:54 +0100 | [diff] [blame] | 844 | endif |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 845 | |
Nam T. Nguyen | 128c32e | 2015-05-18 11:37:27 -0700 | [diff] [blame] | 846 | install-tools: all install-gtk |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 847 | $(call QUIET_INSTALL, binaries) \ |
| 848 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \ |
| 849 | $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \ |
| 850 | $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace' |
Adrian Hunter | e477f3f | 2014-10-23 18:16:03 -0300 | [diff] [blame] | 851 | ifndef NO_PERF_READ_VDSO32 |
| 852 | $(call QUIET_INSTALL, perf-read-vdso32) \ |
| 853 | $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)'; |
| 854 | endif |
| 855 | ifndef NO_PERF_READ_VDSOX32 |
| 856 | $(call QUIET_INSTALL, perf-read-vdsox32) \ |
| 857 | $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(bindir_SQ)'; |
| 858 | endif |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 859 | ifndef NO_JVMTI |
| 860 | $(call QUIET_INSTALL, $(LIBJVMTI)) \ |
Laura Abbott | cd7f355 | 2017-01-06 14:18:08 -0800 | [diff] [blame] | 861 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \ |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 862 | $(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)'; |
| 863 | endif |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 864 | $(call QUIET_INSTALL, libexec) \ |
| 865 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' |
Arnaldo Carvalho de Melo | 1b16fff | 2018-05-04 10:37:27 -0300 | [diff] [blame] | 866 | ifndef NO_LIBBPF |
Arnaldo Carvalho de Melo | dad2762 | 2018-08-29 17:31:52 -0300 | [diff] [blame] | 867 | $(call QUIET_INSTALL, bpf-headers) \ |
| 868 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ |
Arnaldo Carvalho de Melo | 403f833 | 2018-08-29 17:41:53 -0300 | [diff] [blame] | 869 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux'; \ |
| 870 | $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ |
| 871 | $(INSTALL) include/bpf/linux/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux' |
Arnaldo Carvalho de Melo | dad2762 | 2018-08-29 17:31:52 -0300 | [diff] [blame] | 872 | $(call QUIET_INSTALL, bpf-examples) \ |
| 873 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'; \ |
| 874 | $(INSTALL) examples/bpf/*.c -t '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf' |
Arnaldo Carvalho de Melo | 1b16fff | 2018-05-04 10:37:27 -0300 | [diff] [blame] | 875 | endif |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 876 | $(call QUIET_INSTALL, perf-archive) \ |
| 877 | $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' |
Adrian Hunter | c501e90 | 2014-07-31 09:01:12 +0300 | [diff] [blame] | 878 | $(call QUIET_INSTALL, perf-with-kcore) \ |
| 879 | $(INSTALL) $(OUTPUT)perf-with-kcore -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' |
Arnaldo Carvalho de Melo | 005438a8 | 2015-07-20 12:02:09 -0300 | [diff] [blame] | 880 | ifndef NO_LIBAUDIT |
| 881 | $(call QUIET_INSTALL, strace/groups) \ |
| 882 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'; \ |
| 883 | $(INSTALL) trace/strace/groups/* -t '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)' |
| 884 | endif |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 885 | ifndef NO_LIBPERL |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 886 | $(call QUIET_INSTALL, perl-scripts) \ |
| 887 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ |
| 888 | $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ |
| 889 | $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \ |
| 890 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \ |
| 891 | $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 892 | endif |
| 893 | ifndef NO_LIBPYTHON |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 894 | $(call QUIET_INSTALL, python-scripts) \ |
| 895 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ |
| 896 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \ |
Tony Jones | a38352d | 2019-01-23 16:52:28 -0800 | [diff] [blame] | 897 | $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ |
| 898 | $(INSTALL) scripts/python/*.py -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 899 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 900 | endif |
Ramkumar Ramachandra | a8b4c701 | 2013-11-17 21:43:27 +0530 | [diff] [blame] | 901 | $(call QUIET_INSTALL, perf_completion-script) \ |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 902 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \ |
Ramkumar Ramachandra | a8b4c701 | 2013-11-17 21:43:27 +0530 | [diff] [blame] | 903 | $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf' |
Namhyung Kim | 14cbfbe | 2016-01-07 20:41:53 +0900 | [diff] [blame] | 904 | $(call QUIET_INSTALL, perf-tip) \ |
| 905 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(tip_instdir_SQ)'; \ |
| 906 | $(INSTALL) Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)' |
Nam T. Nguyen | 128c32e | 2015-05-18 11:37:27 -0700 | [diff] [blame] | 907 | |
| 908 | install-tests: all install-gtk |
Ingo Molnar | 8a5411e9 | 2013-10-09 11:49:29 +0200 | [diff] [blame] | 909 | $(call QUIET_INSTALL, tests) \ |
| 910 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ |
| 911 | $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ |
| 912 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ |
Arnaldo Carvalho de Melo | 122e0b9 | 2017-08-04 12:19:44 -0300 | [diff] [blame] | 913 | $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ |
| 914 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ |
Arnaldo Carvalho de Melo | 5ce669a | 2017-08-04 14:18:29 -0300 | [diff] [blame] | 915 | $(INSTALL) tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ |
| 916 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \ |
| 917 | $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib' |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 918 | |
Arnaldo Carvalho de Melo | 30a9c64 | 2017-01-03 12:03:59 -0300 | [diff] [blame] | 919 | install-bin: install-tools install-tests install-traceevent-plugins |
Nam T. Nguyen | 128c32e | 2015-05-18 11:37:27 -0700 | [diff] [blame] | 920 | |
Arnaldo Carvalho de Melo | 30a9c64 | 2017-01-03 12:03:59 -0300 | [diff] [blame] | 921 | install: install-bin try-install-man |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 922 | |
| 923 | install-python_ext: |
| 924 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' |
| 925 | |
| 926 | # 'make install-doc' should call 'make -C Documentation install' |
| 927 | $(INSTALL_DOC_TARGETS): |
| 928 | $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=) |
| 929 | |
| 930 | ### Cleaning rules |
| 931 | |
| 932 | # |
Jiri Olsa | 4842576 | 2016-08-01 20:02:33 +0200 | [diff] [blame] | 933 | # This is here, not in Makefile.config, because Makefile.config does |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 934 | # not get included for the clean target: |
| 935 | # |
| 936 | config-clean: |
Ingo Molnar | 8ec19c0 | 2013-10-09 11:49:26 +0200 | [diff] [blame] | 937 | $(call QUIET_CLEAN, config) |
Josh Poimboeuf | 8f46dfd | 2015-12-13 22:18:05 -0600 | [diff] [blame] | 938 | $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 939 | |
Jiri Olsa | 80f8735 | 2017-09-08 10:46:21 +0200 | [diff] [blame] | 940 | python-clean: |
| 941 | $(python-clean) |
| 942 | |
| 943 | clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean |
Jiri Olsa | 6368942 | 2019-02-13 13:32:38 +0100 | [diff] [blame] | 944 | $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) |
Josh Poimboeuf | 8f46dfd | 2015-12-13 22:18:05 -0600 | [diff] [blame] | 945 | $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete |
Aaro Koskinen | 64227379 | 2015-07-01 14:54:42 +0300 | [diff] [blame] | 946 | $(Q)$(RM) $(OUTPUT).config-detected |
Jiri Olsa | d4dfdf0 | 2016-11-02 14:35:49 +0100 | [diff] [blame] | 947 | $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so |
Adrian Hunter | 237fae7 | 2015-08-13 10:14:55 +0300 | [diff] [blame] | 948 | $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \ |
Jiri Olsa | 85e0d50 | 2017-02-17 15:00:54 +0100 | [diff] [blame] | 949 | $(OUTPUT)util/intel-pt-decoder/inat-tables.c \ |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 950 | $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \ |
Arnaldo Carvalho de Melo | ef9811f | 2017-07-31 16:47:37 -0300 | [diff] [blame] | 951 | $(OUTPUT)pmu-events/pmu-events.c \ |
Arnaldo Carvalho de Melo | 42337cb | 2018-12-18 11:54:31 -0300 | [diff] [blame] | 952 | $(OUTPUT)$(fadvise_advice_array) \ |
Arnaldo Carvalho de Melo | dcc6fd6 | 2019-05-21 15:36:44 -0300 | [diff] [blame] | 953 | $(OUTPUT)$(fsconfig_arrays) \ |
Arnaldo Carvalho de Melo | f6af095 | 2019-05-21 16:34:03 -0300 | [diff] [blame^] | 954 | $(OUTPUT)$(fsmount_arrays) \ |
Arnaldo Carvalho de Melo | 693bd39 | 2019-05-20 16:24:15 -0300 | [diff] [blame] | 955 | $(OUTPUT)$(fspick_arrays) \ |
Arnaldo Carvalho de Melo | 5a54c2f | 2017-09-20 12:30:36 -0300 | [diff] [blame] | 956 | $(OUTPUT)$(madvise_behavior_array) \ |
Arnaldo Carvalho de Melo | fbd7458 | 2018-10-30 16:11:59 -0300 | [diff] [blame] | 957 | $(OUTPUT)$(mmap_flags_array) \ |
Arnaldo Carvalho de Melo | 73d141a | 2018-10-25 15:18:06 -0300 | [diff] [blame] | 958 | $(OUTPUT)$(mount_flags_array) \ |
Arnaldo Carvalho de Melo | 566e302 | 2019-05-20 14:58:03 -0300 | [diff] [blame] | 959 | $(OUTPUT)$(move_mount_flags_array) \ |
Arnaldo Carvalho de Melo | 2c3e962 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 960 | $(OUTPUT)$(drm_ioctl_array) \ |
Arnaldo Carvalho de Melo | 83bc9c37 | 2017-08-28 11:47:11 -0300 | [diff] [blame] | 961 | $(OUTPUT)$(pkey_alloc_access_rights_array) \ |
Arnaldo Carvalho de Melo | 2c3e962 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 962 | $(OUTPUT)$(sndrv_ctl_ioctl_array) \ |
Arnaldo Carvalho de Melo | 45717b7 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 963 | $(OUTPUT)$(sndrv_pcm_ioctl_array) \ |
Arnaldo Carvalho de Melo | ec6dd85 | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 964 | $(OUTPUT)$(kvm_ioctl_array) \ |
Arnaldo Carvalho de Melo | 1de3038 | 2017-10-31 11:32:23 -0300 | [diff] [blame] | 965 | $(OUTPUT)$(kcmp_type_array) \ |
Arnaldo Carvalho de Melo | 03aeb6c | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 966 | $(OUTPUT)$(socket_ipproto_array) \ |
Arnaldo Carvalho de Melo | 81e3d8b | 2017-07-31 17:34:47 -0300 | [diff] [blame] | 967 | $(OUTPUT)$(vhost_virtio_ioctl_array) \ |
Arnaldo Carvalho de Melo | d688d03 | 2017-10-26 15:19:35 -0300 | [diff] [blame] | 968 | $(OUTPUT)$(perf_ioctl_array) \ |
Hendrik Brueckner | 0337cf7 | 2018-01-19 09:56:15 +0100 | [diff] [blame] | 969 | $(OUTPUT)$(prctl_option_array) \ |
Arnaldo Carvalho de Melo | 86cf4c6 | 2018-12-27 15:10:34 -0300 | [diff] [blame] | 970 | $(OUTPUT)$(usbdevfs_ioctl_array) \ |
Arnaldo Carvalho de Melo | 40714e8 | 2018-12-17 17:00:14 -0300 | [diff] [blame] | 971 | $(OUTPUT)$(x86_arch_prctl_code_array) \ |
Arnaldo Carvalho de Melo | 5a1cb7e | 2018-12-11 10:26:13 -0300 | [diff] [blame] | 972 | $(OUTPUT)$(rename_flags_array) \ |
Hendrik Brueckner | 0337cf7 | 2018-01-19 09:56:15 +0100 | [diff] [blame] | 973 | $(OUTPUT)$(arch_errno_name_array) |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 974 | $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 975 | |
| 976 | # |
Jiri Olsa | b8e52be | 2016-01-15 04:00:17 +0000 | [diff] [blame] | 977 | # To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY) |
| 978 | # file if defined, with no further action. |
| 979 | feature-dump: |
| 980 | ifdef FEATURE_DUMP_COPY |
| 981 | @cp $(OUTPUT)FEATURE-DUMP $(FEATURE_DUMP_COPY) |
| 982 | @echo "FEATURE-DUMP file copied into $(FEATURE_DUMP_COPY)" |
| 983 | else |
| 984 | @echo "FEATURE-DUMP file available in $(OUTPUT)FEATURE-DUMP" |
| 985 | endif |
| 986 | |
| 987 | # |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 988 | # Trick: if ../../.git does not exist - we are building out of tree for example, |
| 989 | # then force version regeneration: |
| 990 | # |
| 991 | ifeq ($(wildcard ../../.git/HEAD),) |
| 992 | GIT-HEAD-PHONY = ../../.git/HEAD |
| 993 | else |
| 994 | GIT-HEAD-PHONY = |
| 995 | endif |
| 996 | |
Jiri Olsa | 72965b8 | 2014-12-29 13:52:36 +0100 | [diff] [blame] | 997 | FORCE: |
| 998 | |
Namhyung Kim | fc67297 | 2013-09-13 15:27:43 +0900 | [diff] [blame] | 999 | .PHONY: all install clean config-clean strip install-gtk |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 1000 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
Jiri Olsa | 324c824 | 2015-09-23 12:34:01 +0200 | [diff] [blame] | 1001 | .PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE prepare |
Arnaldo Carvalho de Melo | 1b700c9 | 2016-04-04 19:05:36 -0300 | [diff] [blame] | 1002 | .PHONY: libtraceevent_plugins archheaders |
Ingo Molnar | bd69cc2 | 2013-10-02 11:49:08 +0200 | [diff] [blame] | 1003 | |
Jiri Olsa | abb2621 | 2016-12-06 14:18:49 +0100 | [diff] [blame] | 1004 | endif # force_fixdep |