Makefile.perf 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. include ../scripts/Makefile.include
  2. # The default target of this Makefile is...
  3. all:
  4. include ../scripts/utilities.mak
  5. # Define V to have a more verbose compile.
  6. #
  7. # Define VF to have a more verbose feature check output.
  8. #
  9. # Define O to save output files in a separate directory.
  10. #
  11. # Define ARCH as name of target architecture if you want cross-builds.
  12. #
  13. # Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
  14. #
  15. # Define NO_LIBPERL to disable perl script extension.
  16. #
  17. # Define NO_LIBPYTHON to disable python script extension.
  18. #
  19. # Define PYTHON to point to the python binary if the default
  20. # `python' is not correct; for example: PYTHON=python2
  21. #
  22. # Define PYTHON_CONFIG to point to the python-config binary if
  23. # the default `$(PYTHON)-config' is not correct.
  24. #
  25. # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
  26. #
  27. # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
  28. #
  29. # Define LDFLAGS=-static to build a static binary.
  30. #
  31. # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
  32. #
  33. # Define EXCLUDE_EXTLIBS=-lmylib to exclude libmylib from the auto-generated
  34. # EXTLIBS.
  35. #
  36. # Define EXTRA_PERFLIBS to pass extra libraries to PERFLIBS.
  37. #
  38. # Define NO_DWARF if you do not want debug-info analysis feature at all.
  39. #
  40. # Define WERROR=0 to disable treating any warnings as errors.
  41. #
  42. # Define NO_NEWT if you do not want TUI support. (deprecated)
  43. #
  44. # Define NO_SLANG if you do not want TUI support.
  45. #
  46. # Define NO_GTK2 if you do not want GTK+ GUI support.
  47. #
  48. # Define NO_DEMANGLE if you do not want C++ symbol demangling.
  49. #
  50. # Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
  51. #
  52. # Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf
  53. # backtrace post unwind.
  54. #
  55. # Define NO_BACKTRACE if you do not want stack backtrace debug feature
  56. #
  57. # Define NO_LIBNUMA if you do not want numa perf benchmark
  58. #
  59. # Define NO_LIBAUDIT if you do not want libaudit support
  60. #
  61. # Define NO_LIBBIONIC if you do not want bionic support
  62. #
  63. # Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support
  64. # used for generating build-ids for ELFs generated by jitdump.
  65. #
  66. # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
  67. # for dwarf backtrace post unwind.
  68. #
  69. # Define NO_PERF_READ_VDSO32 if you do not want to build perf-read-vdso32
  70. # for reading the 32-bit compatibility VDSO in 64-bit mode
  71. #
  72. # Define NO_PERF_READ_VDSOX32 if you do not want to build perf-read-vdsox32
  73. # for reading the x32 mode 32-bit compatibility VDSO in 64-bit mode
  74. #
  75. # Define NO_ZLIB if you do not want to support compressed kernel modules
  76. #
  77. # Define NO_LIBBABELTRACE if you do not want libbabeltrace support
  78. # for CTF data format.
  79. #
  80. # Define NO_LZMA if you do not want to support compressed (xz) kernel modules
  81. #
  82. # Define NO_AUXTRACE if you do not want AUX area tracing support
  83. #
  84. # Define NO_LIBBPF if you do not want BPF support
  85. #
  86. # Define NO_SDT if you do not want to define SDT event in perf tools,
  87. # note that it doesn't disable SDT scanning support.
  88. #
  89. # Define FEATURES_DUMP to provide features detection dump file
  90. # and bypass the feature detection
  91. #
  92. # Define NO_JVMTI if you do not want jvmti agent built
  93. #
  94. # Define LIBCLANGLLVM if you DO want builtin clang and llvm support.
  95. # When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if
  96. # llvm-config is not in $PATH.
  97. # Define NO_CORESIGHT if you do not want support for CoreSight trace decoding.
  98. # As per kernel Makefile, avoid funny character set dependencies
  99. unexport LC_ALL
  100. LC_COLLATE=C
  101. LC_NUMERIC=C
  102. export LC_COLLATE LC_NUMERIC
  103. ifeq ($(srctree),)
  104. srctree := $(patsubst %/,%,$(dir $(CURDIR)))
  105. srctree := $(patsubst %/,%,$(dir $(srctree)))
  106. #$(info Determined 'srctree' to be $(srctree))
  107. endif
  108. ifneq ($(objtree),)
  109. #$(info Determined 'objtree' to be $(objtree))
  110. endif
  111. ifneq ($(OUTPUT),)
  112. #$(info Determined 'OUTPUT' to be $(OUTPUT))
  113. # Adding $(OUTPUT) as a directory to look for source files,
  114. # because use generated output files as sources dependency
  115. # for flex/bison parsers.
  116. VPATH += $(OUTPUT)
  117. export VPATH
  118. endif
  119. ifeq ($(V),1)
  120. Q =
  121. else
  122. Q = @
  123. endif
  124. # Do not use make's built-in rules
  125. # (this improves performance and avoids hard-to-debug behaviour);
  126. MAKEFLAGS += -r
  127. # Makefiles suck: This macro sets a default value of $(2) for the
  128. # variable named by $(1), unless the variable has been set by
  129. # environment or command line. This is necessary for CC and AR
  130. # because make sets default values, so the simpler ?= approach
  131. # won't work as expected.
  132. define allow-override
  133. $(if $(or $(findstring environment,$(origin $(1))),\
  134. $(findstring command line,$(origin $(1)))),,\
  135. $(eval $(1) = $(2)))
  136. endef
  137. LD += $(EXTRA_LDFLAGS)
  138. PKG_CONFIG = $(CROSS_COMPILE)pkg-config
  139. LLVM_CONFIG ?= llvm-config
  140. RM = rm -f
  141. LN = ln -f
  142. MKDIR = mkdir
  143. FIND = find
  144. INSTALL = install
  145. FLEX ?= flex
  146. BISON ?= bison
  147. STRIP = strip
  148. AWK = awk
  149. # include Makefile.config by default and rule out
  150. # non-config cases
  151. config := 1
  152. 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
  153. ifdef MAKECMDGOALS
  154. ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
  155. config := 0
  156. endif
  157. endif
  158. # The fixdep build - we force fixdep tool to be built as
  159. # the first target in the separate make session not to be
  160. # disturbed by any parallel make jobs. Once fixdep is done
  161. # we issue the requested build with FIXDEP=1 variable.
  162. #
  163. # The fixdep build is disabled for $(NON_CONFIG_TARGETS)
  164. # targets, because it's not necessary.
  165. ifdef FIXDEP
  166. force_fixdep := 0
  167. else
  168. force_fixdep := $(config)
  169. endif
  170. export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
  171. export HOSTCC HOSTLD HOSTAR
  172. include $(srctree)/tools/build/Makefile.include
  173. ifeq ($(force_fixdep),1)
  174. goals := $(filter-out all sub-make, $(MAKECMDGOALS))
  175. $(goals) all: sub-make
  176. sub-make: fixdep
  177. @./check-headers.sh
  178. $(Q)$(MAKE) FIXDEP=1 -f Makefile.perf $(goals)
  179. else # force_fixdep
  180. LIB_DIR = $(srctree)/tools/lib/api/
  181. TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
  182. BPF_DIR = $(srctree)/tools/lib/bpf/
  183. SUBCMD_DIR = $(srctree)/tools/lib/subcmd/
  184. # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
  185. # Without this setting the output feature dump file misses some features, for
  186. # example, liberty. Select all checkers so we won't get an incomplete feature
  187. # dump file.
  188. ifeq ($(config),1)
  189. ifdef MAKECMDGOALS
  190. ifeq ($(filter feature-dump,$(MAKECMDGOALS)),feature-dump)
  191. FEATURE_TESTS := all
  192. endif
  193. endif
  194. include Makefile.config
  195. endif
  196. ifeq ($(config),0)
  197. include $(srctree)/tools/scripts/Makefile.arch
  198. -include arch/$(SRCARCH)/Makefile
  199. endif
  200. # The FEATURE_DUMP_EXPORT holds location of the actual
  201. # FEATURE_DUMP file to be used to bypass feature detection
  202. # (for bpf or any other subproject)
  203. ifeq ($(FEATURES_DUMP),)
  204. FEATURE_DUMP_EXPORT := $(realpath $(OUTPUT)FEATURE-DUMP)
  205. else
  206. FEATURE_DUMP_EXPORT := $(realpath $(FEATURES_DUMP))
  207. endif
  208. export prefix bindir sharedir sysconfdir DESTDIR
  209. # sparse is architecture-neutral, which means that we need to tell it
  210. # explicitly what architecture to check for. Fix this up for yours..
  211. SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
  212. # Guard against environment variables
  213. PYRF_OBJS =
  214. SCRIPT_SH =
  215. SCRIPT_SH += perf-archive.sh
  216. SCRIPT_SH += perf-with-kcore.sh
  217. grep-libs = $(filter -l%,$(1))
  218. strip-libs = $(filter-out -l%,$(1))
  219. ifneq ($(OUTPUT),)
  220. TE_PATH=$(OUTPUT)
  221. BPF_PATH=$(OUTPUT)
  222. SUBCMD_PATH=$(OUTPUT)
  223. ifneq ($(subdir),)
  224. API_PATH=$(OUTPUT)/../lib/api/
  225. else
  226. API_PATH=$(OUTPUT)
  227. endif
  228. else
  229. TE_PATH=$(TRACE_EVENT_DIR)
  230. API_PATH=$(LIB_DIR)
  231. BPF_PATH=$(BPF_DIR)
  232. SUBCMD_PATH=$(SUBCMD_DIR)
  233. endif
  234. LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
  235. export LIBTRACEEVENT
  236. LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list
  237. #
  238. # The static build has no dynsym table, so this does not work for
  239. # static build. Looks like linker starts to scream about that now
  240. # (in Fedora 26) so we need to switch it off for static build.
  241. DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
  242. LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = $(if $(findstring -static,$(LDFLAGS)),,$(DYNAMIC_LIST_LDFLAGS))
  243. LIBAPI = $(API_PATH)libapi.a
  244. export LIBAPI
  245. LIBBPF = $(BPF_PATH)libbpf.a
  246. LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
  247. # python extension build directories
  248. PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
  249. PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
  250. PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
  251. export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
  252. python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
  253. PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
  254. PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI)
  255. SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
  256. PROGRAMS += $(OUTPUT)perf
  257. ifndef NO_PERF_READ_VDSO32
  258. PROGRAMS += $(OUTPUT)perf-read-vdso32
  259. endif
  260. ifndef NO_PERF_READ_VDSOX32
  261. PROGRAMS += $(OUTPUT)perf-read-vdsox32
  262. endif
  263. LIBJVMTI = libperf-jvmti.so
  264. ifndef NO_JVMTI
  265. PROGRAMS += $(OUTPUT)$(LIBJVMTI)
  266. endif
  267. # what 'all' will build and 'install' will install, in perfexecdir
  268. ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
  269. # what 'all' will build but not install in perfexecdir
  270. OTHER_PROGRAMS = $(OUTPUT)perf
  271. # Set paths to tools early so that they can be used for version tests.
  272. ifndef SHELL_PATH
  273. SHELL_PATH = /bin/sh
  274. endif
  275. ifndef PERL_PATH
  276. PERL_PATH = /usr/bin/perl
  277. endif
  278. export PERL_PATH
  279. LIB_FILE=$(OUTPUT)libperf.a
  280. PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
  281. ifndef NO_LIBBPF
  282. PERFLIBS += $(LIBBPF)
  283. endif
  284. # We choose to avoid "if .. else if .. else .. endif endif"
  285. # because maintaining the nesting to match is a pain. If
  286. # we had "elif" things would have been much nicer...
  287. ifneq ($(OUTPUT),)
  288. CFLAGS += -I$(OUTPUT)
  289. endif
  290. ifndef NO_GTK2
  291. ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so
  292. GTK_IN := $(OUTPUT)gtk-in.o
  293. endif
  294. ifdef ASCIIDOC8
  295. export ASCIIDOC8
  296. endif
  297. EXTLIBS := $(call filter-out,$(EXCLUDE_EXTLIBS),$(EXTLIBS))
  298. LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
  299. ifeq ($(USE_CLANG), 1)
  300. CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization
  301. CLANGLIBS_NOEXT_LIST = $(foreach l,$(CLANGLIBS_LIST),$(shell $(LLVM_CONFIG) --libdir)/libclang$(l))
  302. LIBCLANG = $(foreach l,$(CLANGLIBS_NOEXT_LIST),$(wildcard $(l).a $(l).so))
  303. LIBS += -Wl,--start-group $(LIBCLANG) -Wl,--end-group
  304. endif
  305. ifeq ($(USE_LLVM), 1)
  306. LIBLLVM = $(shell $(LLVM_CONFIG) --libs all) $(shell $(LLVM_CONFIG) --system-libs)
  307. LIBS += -L$(shell $(LLVM_CONFIG) --libdir) $(LIBLLVM)
  308. endif
  309. ifeq ($(USE_CXX), 1)
  310. LIBS += -lstdc++
  311. endif
  312. export INSTALL SHELL_PATH
  313. ### Build rules
  314. SHELL = $(SHELL_PATH)
  315. linux_uapi_dir := $(srctree)/tools/include/uapi/linux
  316. beauty_outdir := $(OUTPUT)trace/beauty/generated
  317. beauty_ioctl_outdir := $(beauty_outdir)/ioctl
  318. drm_ioctl_array := $(beauty_ioctl_outdir)/drm_ioctl_array.c
  319. drm_hdr_dir := $(srctree)/tools/include/uapi/drm
  320. drm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/drm_ioctl.sh
  321. # Create output directory if not already present
  322. _dummy := $(shell [ -d '$(beauty_ioctl_outdir)' ] || mkdir -p '$(beauty_ioctl_outdir)')
  323. $(drm_ioctl_array): $(drm_hdr_dir)/drm.h $(drm_hdr_dir)/i915_drm.h $(drm_ioctl_tbl)
  324. $(Q)$(SHELL) '$(drm_ioctl_tbl)' $(drm_hdr_dir) > $@
  325. pkey_alloc_access_rights_array := $(beauty_outdir)/pkey_alloc_access_rights_array.c
  326. asm_generic_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/
  327. pkey_alloc_access_rights_tbl := $(srctree)/tools/perf/trace/beauty/pkey_alloc_access_rights.sh
  328. $(pkey_alloc_access_rights_array): $(asm_generic_hdr_dir)/mman-common.h $(pkey_alloc_access_rights_tbl)
  329. $(Q)$(SHELL) '$(pkey_alloc_access_rights_tbl)' $(asm_generic_hdr_dir) > $@
  330. sndrv_ctl_ioctl_array := $(beauty_ioctl_outdir)/sndrv_ctl_ioctl_array.c
  331. sndrv_ctl_hdr_dir := $(srctree)/tools/include/uapi/sound
  332. sndrv_ctl_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh
  333. $(sndrv_ctl_ioctl_array): $(sndrv_ctl_hdr_dir)/asound.h $(sndrv_ctl_ioctl_tbl)
  334. $(Q)$(SHELL) '$(sndrv_ctl_ioctl_tbl)' $(sndrv_ctl_hdr_dir) > $@
  335. sndrv_pcm_ioctl_array := $(beauty_ioctl_outdir)/sndrv_pcm_ioctl_array.c
  336. sndrv_pcm_hdr_dir := $(srctree)/tools/include/uapi/sound
  337. sndrv_pcm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh
  338. $(sndrv_pcm_ioctl_array): $(sndrv_pcm_hdr_dir)/asound.h $(sndrv_pcm_ioctl_tbl)
  339. $(Q)$(SHELL) '$(sndrv_pcm_ioctl_tbl)' $(sndrv_pcm_hdr_dir) > $@
  340. kcmp_type_array := $(beauty_outdir)/kcmp_type_array.c
  341. kcmp_hdr_dir := $(srctree)/tools/include/uapi/linux/
  342. kcmp_type_tbl := $(srctree)/tools/perf/trace/beauty/kcmp_type.sh
  343. $(kcmp_type_array): $(kcmp_hdr_dir)/kcmp.h $(kcmp_type_tbl)
  344. $(Q)$(SHELL) '$(kcmp_type_tbl)' $(kcmp_hdr_dir) > $@
  345. kvm_ioctl_array := $(beauty_ioctl_outdir)/kvm_ioctl_array.c
  346. kvm_hdr_dir := $(srctree)/tools/include/uapi/linux
  347. kvm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/kvm_ioctl.sh
  348. $(kvm_ioctl_array): $(kvm_hdr_dir)/kvm.h $(kvm_ioctl_tbl)
  349. $(Q)$(SHELL) '$(kvm_ioctl_tbl)' $(kvm_hdr_dir) > $@
  350. socket_ipproto_array := $(beauty_outdir)/socket_ipproto_array.c
  351. socket_ipproto_tbl := $(srctree)/tools/perf/trace/beauty/socket_ipproto.sh
  352. $(socket_ipproto_array): $(linux_uapi_dir)/in.h $(socket_ipproto_tbl)
  353. $(Q)$(SHELL) '$(socket_ipproto_tbl)' $(linux_uapi_dir) > $@
  354. vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c
  355. vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux
  356. vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh
  357. $(vhost_virtio_ioctl_array): $(vhost_virtio_hdr_dir)/vhost.h $(vhost_virtio_ioctl_tbl)
  358. $(Q)$(SHELL) '$(vhost_virtio_ioctl_tbl)' $(vhost_virtio_hdr_dir) > $@
  359. perf_ioctl_array := $(beauty_ioctl_outdir)/perf_ioctl_array.c
  360. perf_hdr_dir := $(srctree)/tools/include/uapi/linux
  361. perf_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/perf_ioctl.sh
  362. $(perf_ioctl_array): $(perf_hdr_dir)/perf_event.h $(perf_ioctl_tbl)
  363. $(Q)$(SHELL) '$(perf_ioctl_tbl)' $(perf_hdr_dir) > $@
  364. madvise_behavior_array := $(beauty_outdir)/madvise_behavior_array.c
  365. madvise_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/
  366. madvise_behavior_tbl := $(srctree)/tools/perf/trace/beauty/madvise_behavior.sh
  367. $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl)
  368. $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@
  369. prctl_option_array := $(beauty_outdir)/prctl_option_array.c
  370. prctl_hdr_dir := $(srctree)/tools/include/uapi/linux/
  371. prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh
  372. $(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl)
  373. $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@
  374. arch_errno_name_array := $(beauty_outdir)/arch_errno_name_array.c
  375. arch_errno_hdr_dir := $(srctree)/tools
  376. arch_errno_tbl := $(srctree)/tools/perf/trace/beauty/arch_errno_names.sh
  377. $(arch_errno_name_array): $(arch_errno_tbl)
  378. $(Q)$(SHELL) '$(arch_errno_tbl)' $(CC) $(arch_errno_hdr_dir) > $@
  379. all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
  380. $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
  381. $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
  382. CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
  383. $(PYTHON_WORD) util/setup.py \
  384. --quiet build_ext; \
  385. mkdir -p $(OUTPUT)python && \
  386. cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/
  387. please_set_SHELL_PATH_to_a_more_modern_shell:
  388. $(Q)$$(:)
  389. shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
  390. strip: $(PROGRAMS) $(OUTPUT)perf
  391. $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
  392. PERF_IN := $(OUTPUT)perf-in.o
  393. JEVENTS := $(OUTPUT)pmu-events/jevents
  394. JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
  395. PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
  396. export JEVENTS
  397. build := -f $(srctree)/tools/build/Makefile.build dir=. obj
  398. $(PERF_IN): prepare FORCE
  399. $(Q)$(MAKE) $(build)=perf
  400. $(JEVENTS_IN): FORCE
  401. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=jevents
  402. $(JEVENTS): $(JEVENTS_IN)
  403. $(QUIET_LINK)$(HOSTCC) $(JEVENTS_IN) -o $@
  404. $(PMU_EVENTS_IN): $(JEVENTS) FORCE
  405. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
  406. $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
  407. $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
  408. $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
  409. $(GTK_IN): FORCE
  410. $(Q)$(MAKE) $(build)=gtk
  411. $(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
  412. $(QUIET_LINK)$(CC) -o $@ -shared $(LDFLAGS) $(filter %.o,$^) $(GTK_LIBS)
  413. $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
  414. $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
  415. $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
  416. $(SCRIPTS) : % : %.sh
  417. $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
  418. $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
  419. $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
  420. $(Q)touch $(OUTPUT)PERF-VERSION-FILE
  421. # These can record PERF_VERSION
  422. perf.spec $(SCRIPTS) \
  423. : $(OUTPUT)PERF-VERSION-FILE
  424. .SUFFIXES:
  425. #
  426. # If a target does not match any of the later rules then prefix it by $(OUTPUT)
  427. # This makes targets like 'make O=/tmp/perf perf.o' work in a natural way.
  428. #
  429. ifneq ($(OUTPUT),)
  430. %.o: $(OUTPUT)%.o
  431. @echo " # Redirected target $@ => $(OUTPUT)$@"
  432. pmu-events/%.o: $(OUTPUT)pmu-events/%.o
  433. @echo " # Redirected target $@ => $(OUTPUT)$@"
  434. util/%.o: $(OUTPUT)util/%.o
  435. @echo " # Redirected target $@ => $(OUTPUT)$@"
  436. bench/%.o: $(OUTPUT)bench/%.o
  437. @echo " # Redirected target $@ => $(OUTPUT)$@"
  438. tests/%.o: $(OUTPUT)tests/%.o
  439. @echo " # Redirected target $@ => $(OUTPUT)$@"
  440. endif
  441. # These two need to be here so that when O= is not used they take precedence
  442. # over the general rule for .o
  443. # get relative building directory (to $(OUTPUT))
  444. # and '.' if it's $(OUTPUT) itself
  445. __build-dir = $(subst $(OUTPUT),,$(dir $@))
  446. build-dir = $(if $(__build-dir),$(__build-dir),.)
  447. prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioctl_array) \
  448. $(pkey_alloc_access_rights_array) \
  449. $(sndrv_pcm_ioctl_array) \
  450. $(sndrv_ctl_ioctl_array) \
  451. $(kcmp_type_array) \
  452. $(kvm_ioctl_array) \
  453. $(socket_ipproto_array) \
  454. $(vhost_virtio_ioctl_array) \
  455. $(madvise_behavior_array) \
  456. $(perf_ioctl_array) \
  457. $(prctl_option_array) \
  458. $(arch_errno_name_array)
  459. $(OUTPUT)%.o: %.c prepare FORCE
  460. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  461. $(OUTPUT)%.i: %.c prepare FORCE
  462. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  463. $(OUTPUT)%.s: %.c prepare FORCE
  464. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  465. $(OUTPUT)%-bison.o: %.c prepare FORCE
  466. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  467. $(OUTPUT)%-flex.o: %.c prepare FORCE
  468. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  469. $(OUTPUT)%.o: %.S prepare FORCE
  470. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  471. $(OUTPUT)%.i: %.S prepare FORCE
  472. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
  473. $(OUTPUT)perf-%: %.o $(PERFLIBS)
  474. $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS)
  475. ifndef NO_PERF_READ_VDSO32
  476. $(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-vdso-map.c
  477. $(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
  478. endif
  479. ifndef NO_PERF_READ_VDSOX32
  480. $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c
  481. $(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
  482. endif
  483. ifndef NO_JVMTI
  484. LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o
  485. $(LIBJVMTI_IN): FORCE
  486. $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti
  487. $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)
  488. $(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $<
  489. endif
  490. $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
  491. LIBPERF_IN := $(OUTPUT)libperf-in.o
  492. $(LIBPERF_IN): prepare FORCE
  493. $(Q)$(MAKE) $(build)=libperf
  494. $(LIB_FILE): $(LIBPERF_IN)
  495. $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
  496. LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
  497. $(LIBTRACEEVENT): FORCE
  498. $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
  499. libtraceevent_plugins: FORCE
  500. $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
  501. $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
  502. $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list
  503. $(LIBTRACEEVENT)-clean:
  504. $(call QUIET_CLEAN, libtraceevent)
  505. $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null
  506. install-traceevent-plugins: libtraceevent_plugins
  507. $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
  508. $(LIBAPI): FORCE
  509. $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
  510. $(LIBAPI)-clean:
  511. $(call QUIET_CLEAN, libapi)
  512. $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
  513. $(LIBBPF): FORCE
  514. $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT)
  515. $(LIBBPF)-clean:
  516. $(call QUIET_CLEAN, libbpf)
  517. $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
  518. $(LIBSUBCMD): FORCE
  519. $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
  520. $(LIBSUBCMD)-clean:
  521. $(call QUIET_CLEAN, libsubcmd)
  522. $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) clean
  523. help:
  524. @echo 'Perf make targets:'
  525. @echo ' doc - make *all* documentation (see below)'
  526. @echo ' man - make manpage documentation (access with man <foo>)'
  527. @echo ' html - make html documentation'
  528. @echo ' info - make GNU info documentation (access with info <foo>)'
  529. @echo ' pdf - make pdf documentation'
  530. @echo ' TAGS - use etags to make tag information for source browsing'
  531. @echo ' tags - use ctags to make tag information for source browsing'
  532. @echo ' cscope - use cscope to make interactive browsing database'
  533. @echo ''
  534. @echo 'Perf install targets:'
  535. @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed'
  536. @echo ' HINT: use "prefix" or "DESTDIR" to install to a particular'
  537. @echo ' path like "make prefix=/usr/local install install-doc"'
  538. @echo ' install - install compiled binaries'
  539. @echo ' install-doc - install *all* documentation'
  540. @echo ' install-man - install manpage documentation'
  541. @echo ' install-html - install html documentation'
  542. @echo ' install-info - install GNU info documentation'
  543. @echo ' install-pdf - install pdf documentation'
  544. @echo ''
  545. @echo ' quick-install-doc - alias for quick-install-man'
  546. @echo ' quick-install-man - install the documentation quickly'
  547. @echo ' quick-install-html - install the html documentation quickly'
  548. @echo ''
  549. @echo 'Perf maintainer targets:'
  550. @echo ' clean - clean all binary objects and build output'
  551. DOC_TARGETS := doc man html info pdf
  552. INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
  553. INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
  554. # 'make doc' should call 'make -C Documentation all'
  555. $(DOC_TARGETS):
  556. $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
  557. TAG_FOLDERS= . ../lib ../include
  558. TAG_FILES= ../../include/uapi/linux/perf_event.h
  559. TAGS:
  560. $(QUIET_GEN)$(RM) TAGS; \
  561. $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs etags -a $(TAG_FILES)
  562. tags:
  563. $(QUIET_GEN)$(RM) tags; \
  564. $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs ctags -a $(TAG_FILES)
  565. cscope:
  566. $(QUIET_GEN)$(RM) cscope*; \
  567. $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print -o -name '*.cpp' -print | xargs cscope -b $(TAG_FILES)
  568. ### Testing rules
  569. # GNU make supports exporting all variables by "export" without parameters.
  570. # However, the environment gets quite big, and some programs have problems
  571. # with that.
  572. check: $(OUTPUT)common-cmds.h
  573. if sparse; \
  574. then \
  575. for i in *.c */*.c; \
  576. do \
  577. sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
  578. done; \
  579. else \
  580. exit 1; \
  581. fi
  582. ### Installation rules
  583. ifndef NO_GTK2
  584. install-gtk: $(OUTPUT)libperf-gtk.so
  585. $(call QUIET_INSTALL, 'GTK UI') \
  586. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
  587. $(INSTALL) $(OUTPUT)libperf-gtk.so '$(DESTDIR_SQ)$(libdir_SQ)'
  588. else
  589. install-gtk:
  590. endif
  591. install-tools: all install-gtk
  592. $(call QUIET_INSTALL, binaries) \
  593. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
  594. $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \
  595. $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
  596. ifndef NO_PERF_READ_VDSO32
  597. $(call QUIET_INSTALL, perf-read-vdso32) \
  598. $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)';
  599. endif
  600. ifndef NO_PERF_READ_VDSOX32
  601. $(call QUIET_INSTALL, perf-read-vdsox32) \
  602. $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(bindir_SQ)';
  603. endif
  604. ifndef NO_JVMTI
  605. $(call QUIET_INSTALL, $(LIBJVMTI)) \
  606. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \
  607. $(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)';
  608. endif
  609. $(call QUIET_INSTALL, libexec) \
  610. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
  611. ifndef NO_LIBBPF
  612. $(call QUIET_INSTALL, bpf-headers) \
  613. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \
  614. $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'
  615. $(call QUIET_INSTALL, bpf-examples) \
  616. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'; \
  617. $(INSTALL) examples/bpf/*.c -t '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'
  618. endif
  619. $(call QUIET_INSTALL, perf-archive) \
  620. $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
  621. $(call QUIET_INSTALL, perf-with-kcore) \
  622. $(INSTALL) $(OUTPUT)perf-with-kcore -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
  623. ifndef NO_LIBAUDIT
  624. $(call QUIET_INSTALL, strace/groups) \
  625. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'; \
  626. $(INSTALL) trace/strace/groups/* -t '$(DESTDIR_SQ)$(STRACE_GROUPS_INSTDIR_SQ)'
  627. endif
  628. ifndef NO_LIBPERL
  629. $(call QUIET_INSTALL, perl-scripts) \
  630. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
  631. $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
  632. $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \
  633. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \
  634. $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
  635. endif
  636. ifndef NO_LIBPYTHON
  637. $(call QUIET_INSTALL, python-scripts) \
  638. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
  639. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \
  640. $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \
  641. $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \
  642. $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
  643. endif
  644. $(call QUIET_INSTALL, perf_completion-script) \
  645. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
  646. $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf'
  647. $(call QUIET_INSTALL, perf-tip) \
  648. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(tip_instdir_SQ)'; \
  649. $(INSTALL) Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)'
  650. install-tests: all install-gtk
  651. $(call QUIET_INSTALL, tests) \
  652. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
  653. $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
  654. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
  655. $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
  656. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
  657. $(INSTALL) tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
  658. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \
  659. $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'
  660. install-bin: install-tools install-tests install-traceevent-plugins
  661. install: install-bin try-install-man
  662. install-python_ext:
  663. $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
  664. # 'make install-doc' should call 'make -C Documentation install'
  665. $(INSTALL_DOC_TARGETS):
  666. $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
  667. ### Cleaning rules
  668. #
  669. # This is here, not in Makefile.config, because Makefile.config does
  670. # not get included for the clean target:
  671. #
  672. config-clean:
  673. $(call QUIET_CLEAN, config)
  674. $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null
  675. python-clean:
  676. $(python-clean)
  677. clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
  678. $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
  679. $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
  680. $(Q)$(RM) $(OUTPUT).config-detected
  681. $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
  682. $(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* \
  683. $(OUTPUT)util/intel-pt-decoder/inat-tables.c \
  684. $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
  685. $(OUTPUT)pmu-events/pmu-events.c \
  686. $(OUTPUT)$(madvise_behavior_array) \
  687. $(OUTPUT)$(drm_ioctl_array) \
  688. $(OUTPUT)$(pkey_alloc_access_rights_array) \
  689. $(OUTPUT)$(sndrv_ctl_ioctl_array) \
  690. $(OUTPUT)$(sndrv_pcm_ioctl_array) \
  691. $(OUTPUT)$(kvm_ioctl_array) \
  692. $(OUTPUT)$(kcmp_type_array) \
  693. $(OUTPUT)$(socket_ipproto_array) \
  694. $(OUTPUT)$(vhost_virtio_ioctl_array) \
  695. $(OUTPUT)$(perf_ioctl_array) \
  696. $(OUTPUT)$(prctl_option_array) \
  697. $(OUTPUT)$(arch_errno_name_array)
  698. $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
  699. #
  700. # To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
  701. # file if defined, with no further action.
  702. feature-dump:
  703. ifdef FEATURE_DUMP_COPY
  704. @cp $(OUTPUT)FEATURE-DUMP $(FEATURE_DUMP_COPY)
  705. @echo "FEATURE-DUMP file copied into $(FEATURE_DUMP_COPY)"
  706. else
  707. @echo "FEATURE-DUMP file available in $(OUTPUT)FEATURE-DUMP"
  708. endif
  709. #
  710. # Trick: if ../../.git does not exist - we are building out of tree for example,
  711. # then force version regeneration:
  712. #
  713. ifeq ($(wildcard ../../.git/HEAD),)
  714. GIT-HEAD-PHONY = ../../.git/HEAD
  715. else
  716. GIT-HEAD-PHONY =
  717. endif
  718. FORCE:
  719. .PHONY: all install clean config-clean strip install-gtk
  720. .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
  721. .PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE prepare
  722. .PHONY: libtraceevent_plugins archheaders
  723. endif # force_fixdep