Makefile 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. ifeq ("$(origin O)", "command line")
  2. OUTPUT := $(O)/
  3. endif
  4. # The default target of this Makefile is...
  5. all:
  6. include config/utilities.mak
  7. ifneq ($(OUTPUT),)
  8. # check that the output directory actually exists
  9. OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
  10. $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
  11. endif
  12. # Define V to have a more verbose compile.
  13. #
  14. # Define PYTHON to point to the python binary if the default
  15. # `python' is not correct; for example: PYTHON=python2
  16. #
  17. # Define PYTHON_CONFIG to point to the python-config binary if
  18. # the default `$(PYTHON)-config' is not correct.
  19. #
  20. # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
  21. #
  22. # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
  23. #
  24. # Define LDFLAGS=-static to build a static binary.
  25. #
  26. # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
  27. #
  28. # Define NO_DWARF if you do not want debug-info analysis feature at all.
  29. #
  30. # Define WERROR=0 to disable treating any warnings as errors.
  31. $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
  32. @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
  33. -include $(OUTPUT)PERF-VERSION-FILE
  34. uname_M := $(shell uname -m 2>/dev/null || echo not)
  35. ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
  36. -e s/arm.*/arm/ -e s/sa110/arm/ \
  37. -e s/s390x/s390/ -e s/parisc64/parisc/ \
  38. -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
  39. -e s/sh[234].*/sh/ )
  40. CC = $(CROSS_COMPILE)gcc
  41. AR = $(CROSS_COMPILE)ar
  42. # Additional ARCH settings for x86
  43. ifeq ($(ARCH),i386)
  44. ARCH := x86
  45. endif
  46. ifeq ($(ARCH),x86_64)
  47. ARCH := x86
  48. IS_X86_64 := 0
  49. ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
  50. IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
  51. endif
  52. ifeq (${IS_X86_64}, 1)
  53. RAW_ARCH := x86_64
  54. ARCH_CFLAGS := -DARCH_X86_64
  55. ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S
  56. endif
  57. endif
  58. # Treat warnings as errors unless directed not to
  59. ifneq ($(WERROR),0)
  60. CFLAGS_WERROR := -Werror
  61. endif
  62. #
  63. # Include saner warnings here, which can catch bugs:
  64. #
  65. EXTRA_WARNINGS := -Wformat
  66. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security
  67. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k
  68. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow
  69. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self
  70. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked
  71. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls
  72. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3
  73. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default
  74. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum
  75. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers
  76. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef
  77. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings
  78. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast
  79. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations
  80. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes
  81. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs
  82. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
  83. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
  84. EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
  85. ifeq ("$(origin DEBUG)", "command line")
  86. PERF_DEBUG = $(DEBUG)
  87. endif
  88. ifndef PERF_DEBUG
  89. CFLAGS_OPTIMIZE = -O6
  90. endif
  91. CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
  92. EXTLIBS = -lpthread -lrt -lelf -lm
  93. ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  94. ALL_LDFLAGS = $(LDFLAGS)
  95. STRIP ?= strip
  96. # Among the variables below, these:
  97. # perfexecdir
  98. # template_dir
  99. # mandir
  100. # infodir
  101. # htmldir
  102. # ETC_PERFCONFIG (but not sysconfdir)
  103. # can be specified as a relative path some/where/else;
  104. # this is interpreted as relative to $(prefix) and "perf" at
  105. # runtime figures out where they are based on the path to the executable.
  106. # This can help installing the suite in a relocatable way.
  107. # Make the path relative to DESTDIR, not to prefix
  108. ifndef DESTDIR
  109. prefix = $(HOME)
  110. endif
  111. bindir_relative = bin
  112. bindir = $(prefix)/$(bindir_relative)
  113. mandir = share/man
  114. infodir = share/info
  115. perfexecdir = libexec/perf-core
  116. sharedir = $(prefix)/share
  117. template_dir = share/perf-core/templates
  118. htmldir = share/doc/perf-doc
  119. ifeq ($(prefix),/usr)
  120. sysconfdir = /etc
  121. ETC_PERFCONFIG = $(sysconfdir)/perfconfig
  122. else
  123. sysconfdir = $(prefix)/etc
  124. ETC_PERFCONFIG = etc/perfconfig
  125. endif
  126. lib = lib
  127. export prefix bindir sharedir sysconfdir
  128. RM = rm -f
  129. MKDIR = mkdir
  130. FIND = find
  131. INSTALL = install
  132. # sparse is architecture-neutral, which means that we need to tell it
  133. # explicitly what architecture to check for. Fix this up for yours..
  134. SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
  135. -include config/feature-tests.mak
  136. ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -fstack-protector-all),y)
  137. CFLAGS := $(CFLAGS) -fstack-protector-all
  138. endif
  139. ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wstack-protector),y)
  140. CFLAGS := $(CFLAGS) -Wstack-protector
  141. endif
  142. ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wvolatile-register-var),y)
  143. CFLAGS := $(CFLAGS) -Wvolatile-register-var
  144. endif
  145. ### --- END CONFIGURATION SECTION ---
  146. BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  147. BASIC_LDFLAGS =
  148. # Guard against environment variables
  149. BUILTIN_OBJS =
  150. LIB_H =
  151. LIB_OBJS =
  152. PYRF_OBJS =
  153. SCRIPT_SH =
  154. SCRIPT_SH += perf-archive.sh
  155. grep-libs = $(filter -l%,$(1))
  156. strip-libs = $(filter-out -l%,$(1))
  157. $(OUTPUT)python/perf.so: $(PYRF_OBJS)
  158. $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
  159. --quiet build_ext; \
  160. mkdir -p $(OUTPUT)python && \
  161. cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
  162. #
  163. # No Perl scripts right now:
  164. #
  165. SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
  166. #
  167. # Single 'perf' binary right now:
  168. #
  169. PROGRAMS += $(OUTPUT)perf
  170. LANG_BINDINGS =
  171. # what 'all' will build and 'install' will install, in perfexecdir
  172. ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
  173. # what 'all' will build but not install in perfexecdir
  174. OTHER_PROGRAMS = $(OUTPUT)perf
  175. # Set paths to tools early so that they can be used for version tests.
  176. ifndef SHELL_PATH
  177. SHELL_PATH = /bin/sh
  178. endif
  179. ifndef PERL_PATH
  180. PERL_PATH = /usr/bin/perl
  181. endif
  182. export PERL_PATH
  183. LIB_FILE=$(OUTPUT)libperf.a
  184. LIB_H += ../../include/linux/perf_event.h
  185. LIB_H += ../../include/linux/rbtree.h
  186. LIB_H += ../../include/linux/list.h
  187. LIB_H += ../../include/linux/const.h
  188. LIB_H += ../../include/linux/hash.h
  189. LIB_H += ../../include/linux/stringify.h
  190. LIB_H += util/include/linux/bitmap.h
  191. LIB_H += util/include/linux/bitops.h
  192. LIB_H += util/include/linux/compiler.h
  193. LIB_H += util/include/linux/const.h
  194. LIB_H += util/include/linux/ctype.h
  195. LIB_H += util/include/linux/kernel.h
  196. LIB_H += util/include/linux/list.h
  197. LIB_H += util/include/linux/module.h
  198. LIB_H += util/include/linux/poison.h
  199. LIB_H += util/include/linux/prefetch.h
  200. LIB_H += util/include/linux/rbtree.h
  201. LIB_H += util/include/linux/string.h
  202. LIB_H += util/include/linux/types.h
  203. LIB_H += util/include/linux/linkage.h
  204. LIB_H += util/include/asm/asm-offsets.h
  205. LIB_H += util/include/asm/bug.h
  206. LIB_H += util/include/asm/byteorder.h
  207. LIB_H += util/include/asm/hweight.h
  208. LIB_H += util/include/asm/swab.h
  209. LIB_H += util/include/asm/system.h
  210. LIB_H += util/include/asm/uaccess.h
  211. LIB_H += util/include/dwarf-regs.h
  212. LIB_H += util/include/asm/dwarf2.h
  213. LIB_H += util/include/asm/cpufeature.h
  214. LIB_H += util/include/asm/unistd_32.h
  215. LIB_H += util/include/asm/unistd_64.h
  216. LIB_H += perf.h
  217. LIB_H += util/annotate.h
  218. LIB_H += util/cache.h
  219. LIB_H += util/callchain.h
  220. LIB_H += util/build-id.h
  221. LIB_H += util/debug.h
  222. LIB_H += util/debugfs.h
  223. LIB_H += util/event.h
  224. LIB_H += util/evsel.h
  225. LIB_H += util/evlist.h
  226. LIB_H += util/exec_cmd.h
  227. LIB_H += util/types.h
  228. LIB_H += util/levenshtein.h
  229. LIB_H += util/map.h
  230. LIB_H += util/parse-options.h
  231. LIB_H += util/parse-events.h
  232. LIB_H += util/quote.h
  233. LIB_H += util/util.h
  234. LIB_H += util/xyarray.h
  235. LIB_H += util/header.h
  236. LIB_H += util/help.h
  237. LIB_H += util/session.h
  238. LIB_H += util/strbuf.h
  239. LIB_H += util/strlist.h
  240. LIB_H += util/strfilter.h
  241. LIB_H += util/svghelper.h
  242. LIB_H += util/tool.h
  243. LIB_H += util/run-command.h
  244. LIB_H += util/sigchain.h
  245. LIB_H += util/symbol.h
  246. LIB_H += util/color.h
  247. LIB_H += util/values.h
  248. LIB_H += util/sort.h
  249. LIB_H += util/hist.h
  250. LIB_H += util/thread.h
  251. LIB_H += util/thread_map.h
  252. LIB_H += util/trace-event.h
  253. LIB_H += util/probe-finder.h
  254. LIB_H += util/dwarf-aux.h
  255. LIB_H += util/probe-event.h
  256. LIB_H += util/pstack.h
  257. LIB_H += util/cpumap.h
  258. LIB_H += util/top.h
  259. LIB_H += $(ARCH_INCLUDE)
  260. LIB_H += util/cgroup.h
  261. LIB_OBJS += $(OUTPUT)util/abspath.o
  262. LIB_OBJS += $(OUTPUT)util/alias.o
  263. LIB_OBJS += $(OUTPUT)util/annotate.o
  264. LIB_OBJS += $(OUTPUT)util/build-id.o
  265. LIB_OBJS += $(OUTPUT)util/config.o
  266. LIB_OBJS += $(OUTPUT)util/ctype.o
  267. LIB_OBJS += $(OUTPUT)util/debugfs.o
  268. LIB_OBJS += $(OUTPUT)util/environment.o
  269. LIB_OBJS += $(OUTPUT)util/event.o
  270. LIB_OBJS += $(OUTPUT)util/evlist.o
  271. LIB_OBJS += $(OUTPUT)util/evsel.o
  272. LIB_OBJS += $(OUTPUT)util/exec_cmd.o
  273. LIB_OBJS += $(OUTPUT)util/help.o
  274. LIB_OBJS += $(OUTPUT)util/levenshtein.o
  275. LIB_OBJS += $(OUTPUT)util/parse-options.o
  276. LIB_OBJS += $(OUTPUT)util/parse-events.o
  277. LIB_OBJS += $(OUTPUT)util/path.o
  278. LIB_OBJS += $(OUTPUT)util/rbtree.o
  279. LIB_OBJS += $(OUTPUT)util/bitmap.o
  280. LIB_OBJS += $(OUTPUT)util/hweight.o
  281. LIB_OBJS += $(OUTPUT)util/run-command.o
  282. LIB_OBJS += $(OUTPUT)util/quote.o
  283. LIB_OBJS += $(OUTPUT)util/strbuf.o
  284. LIB_OBJS += $(OUTPUT)util/string.o
  285. LIB_OBJS += $(OUTPUT)util/strlist.o
  286. LIB_OBJS += $(OUTPUT)util/strfilter.o
  287. LIB_OBJS += $(OUTPUT)util/top.o
  288. LIB_OBJS += $(OUTPUT)util/usage.o
  289. LIB_OBJS += $(OUTPUT)util/wrapper.o
  290. LIB_OBJS += $(OUTPUT)util/sigchain.o
  291. LIB_OBJS += $(OUTPUT)util/symbol.o
  292. LIB_OBJS += $(OUTPUT)util/color.o
  293. LIB_OBJS += $(OUTPUT)util/pager.o
  294. LIB_OBJS += $(OUTPUT)util/header.o
  295. LIB_OBJS += $(OUTPUT)util/callchain.o
  296. LIB_OBJS += $(OUTPUT)util/values.o
  297. LIB_OBJS += $(OUTPUT)util/debug.o
  298. LIB_OBJS += $(OUTPUT)util/map.o
  299. LIB_OBJS += $(OUTPUT)util/pstack.o
  300. LIB_OBJS += $(OUTPUT)util/session.o
  301. LIB_OBJS += $(OUTPUT)util/thread.o
  302. LIB_OBJS += $(OUTPUT)util/thread_map.o
  303. LIB_OBJS += $(OUTPUT)util/trace-event-parse.o
  304. LIB_OBJS += $(OUTPUT)util/trace-event-read.o
  305. LIB_OBJS += $(OUTPUT)util/trace-event-info.o
  306. LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o
  307. LIB_OBJS += $(OUTPUT)util/svghelper.o
  308. LIB_OBJS += $(OUTPUT)util/sort.o
  309. LIB_OBJS += $(OUTPUT)util/hist.o
  310. LIB_OBJS += $(OUTPUT)util/probe-event.o
  311. LIB_OBJS += $(OUTPUT)util/util.o
  312. LIB_OBJS += $(OUTPUT)util/xyarray.o
  313. LIB_OBJS += $(OUTPUT)util/cpumap.o
  314. LIB_OBJS += $(OUTPUT)util/cgroup.o
  315. BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
  316. BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
  317. # Benchmark modules
  318. BUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.o
  319. BUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.o
  320. ifeq ($(RAW_ARCH),x86_64)
  321. BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
  322. endif
  323. BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
  324. BUILTIN_OBJS += $(OUTPUT)builtin-diff.o
  325. BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o
  326. BUILTIN_OBJS += $(OUTPUT)builtin-help.o
  327. BUILTIN_OBJS += $(OUTPUT)builtin-sched.o
  328. BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o
  329. BUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.o
  330. BUILTIN_OBJS += $(OUTPUT)builtin-list.o
  331. BUILTIN_OBJS += $(OUTPUT)builtin-record.o
  332. BUILTIN_OBJS += $(OUTPUT)builtin-report.o
  333. BUILTIN_OBJS += $(OUTPUT)builtin-stat.o
  334. BUILTIN_OBJS += $(OUTPUT)builtin-timechart.o
  335. BUILTIN_OBJS += $(OUTPUT)builtin-top.o
  336. BUILTIN_OBJS += $(OUTPUT)builtin-script.o
  337. BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
  338. BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
  339. BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
  340. BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
  341. BUILTIN_OBJS += $(OUTPUT)builtin-test.o
  342. BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
  343. PERFLIBS = $(LIB_FILE)
  344. # Files needed for the python binding, perf.so
  345. # pyrf is just an internal name needed for all those wrappers.
  346. # This has to be in sync with what is in the 'sources' variable in
  347. # tools/perf/util/setup.py
  348. PYRF_OBJS += $(OUTPUT)util/cpumap.o
  349. PYRF_OBJS += $(OUTPUT)util/ctype.o
  350. PYRF_OBJS += $(OUTPUT)util/evlist.o
  351. PYRF_OBJS += $(OUTPUT)util/evsel.o
  352. PYRF_OBJS += $(OUTPUT)util/python.o
  353. PYRF_OBJS += $(OUTPUT)util/thread_map.o
  354. PYRF_OBJS += $(OUTPUT)util/util.o
  355. PYRF_OBJS += $(OUTPUT)util/xyarray.o
  356. #
  357. # Platform specific tweaks
  358. #
  359. # We choose to avoid "if .. else if .. else .. endif endif"
  360. # because maintaining the nesting to match is a pain. If
  361. # we had "elif" things would have been much nicer...
  362. -include config.mak.autogen
  363. -include config.mak
  364. ifndef NO_DWARF
  365. FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
  366. ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
  367. msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
  368. NO_DWARF := 1
  369. endif # Dwarf support
  370. endif # NO_DWARF
  371. -include arch/$(ARCH)/Makefile
  372. ifneq ($(OUTPUT),)
  373. BASIC_CFLAGS += -I$(OUTPUT)
  374. endif
  375. FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
  376. ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y)
  377. FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
  378. ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y)
  379. msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
  380. else
  381. msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
  382. endif
  383. endif
  384. ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y)
  385. BASIC_CFLAGS += -DLIBELF_NO_MMAP
  386. endif
  387. ifndef NO_DWARF
  388. ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
  389. msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
  390. else
  391. BASIC_CFLAGS += -DDWARF_SUPPORT
  392. EXTLIBS += -lelf -ldw
  393. LIB_OBJS += $(OUTPUT)util/probe-finder.o
  394. LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
  395. endif # PERF_HAVE_DWARF_REGS
  396. endif # NO_DWARF
  397. ifdef NO_NEWT
  398. BASIC_CFLAGS += -DNO_NEWT_SUPPORT
  399. else
  400. FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt
  401. ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y)
  402. msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);
  403. BASIC_CFLAGS += -DNO_NEWT_SUPPORT
  404. else
  405. # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
  406. BASIC_CFLAGS += -I/usr/include/slang
  407. EXTLIBS += -lnewt -lslang
  408. LIB_OBJS += $(OUTPUT)util/ui/setup.o
  409. LIB_OBJS += $(OUTPUT)util/ui/browser.o
  410. LIB_OBJS += $(OUTPUT)util/ui/browsers/annotate.o
  411. LIB_OBJS += $(OUTPUT)util/ui/browsers/hists.o
  412. LIB_OBJS += $(OUTPUT)util/ui/browsers/map.o
  413. LIB_OBJS += $(OUTPUT)util/ui/helpline.o
  414. LIB_OBJS += $(OUTPUT)util/ui/progress.o
  415. LIB_OBJS += $(OUTPUT)util/ui/util.o
  416. LIB_H += util/ui/browser.h
  417. LIB_H += util/ui/browsers/map.h
  418. LIB_H += util/ui/helpline.h
  419. LIB_H += util/ui/keysyms.h
  420. LIB_H += util/ui/libslang.h
  421. LIB_H += util/ui/progress.h
  422. LIB_H += util/ui/util.h
  423. LIB_H += util/ui/ui.h
  424. endif
  425. endif
  426. ifdef NO_LIBPERL
  427. BASIC_CFLAGS += -DNO_LIBPERL
  428. else
  429. PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
  430. PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
  431. PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
  432. PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
  433. FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
  434. ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
  435. BASIC_CFLAGS += -DNO_LIBPERL
  436. else
  437. ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
  438. EXTLIBS += $(PERL_EMBED_LIBADD)
  439. LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
  440. LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
  441. endif
  442. endif
  443. disable-python = $(eval $(disable-python_code))
  444. define disable-python_code
  445. BASIC_CFLAGS += -DNO_LIBPYTHON
  446. $(if $(1),$(warning No $(1) was found))
  447. $(warning Python support won't be built)
  448. endef
  449. override PYTHON := \
  450. $(call get-executable-or-default,PYTHON,python)
  451. ifndef PYTHON
  452. $(call disable-python,python interpreter)
  453. python-clean :=
  454. else
  455. PYTHON_WORD := $(call shell-wordify,$(PYTHON))
  456. # python extension build directories
  457. PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
  458. PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
  459. PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
  460. export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
  461. python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
  462. ifdef NO_LIBPYTHON
  463. $(call disable-python)
  464. else
  465. override PYTHON_CONFIG := \
  466. $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
  467. ifndef PYTHON_CONFIG
  468. $(call disable-python,python-config tool)
  469. else
  470. PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
  471. PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
  472. PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
  473. PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
  474. PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
  475. FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
  476. ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
  477. $(call disable-python,Python.h (for Python 2.x))
  478. else
  479. ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
  480. $(warning Python 3 is not yet supported; please set)
  481. $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
  482. $(warning If you also have Python 2 installed, then)
  483. $(warning try something like:)
  484. $(warning $(and ,))
  485. $(warning $(and ,) make PYTHON=python2)
  486. $(warning $(and ,))
  487. $(warning Otherwise, disable Python support entirely:)
  488. $(warning $(and ,))
  489. $(warning $(and ,) make NO_LIBPYTHON=1)
  490. $(warning $(and ,))
  491. $(error $(and ,))
  492. else
  493. ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
  494. EXTLIBS += $(PYTHON_EMBED_LIBADD)
  495. LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
  496. LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
  497. LANG_BINDINGS += $(OUTPUT)python/perf.so
  498. endif
  499. endif
  500. endif
  501. endif
  502. endif
  503. ifdef NO_DEMANGLE
  504. BASIC_CFLAGS += -DNO_DEMANGLE
  505. else
  506. ifdef HAVE_CPLUS_DEMANGLE
  507. EXTLIBS += -liberty
  508. BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
  509. else
  510. FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd
  511. has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
  512. ifeq ($(has_bfd),y)
  513. EXTLIBS += -lbfd
  514. else
  515. FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
  516. has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY))
  517. ifeq ($(has_bfd_iberty),y)
  518. EXTLIBS += -lbfd -liberty
  519. else
  520. FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
  521. has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z))
  522. ifeq ($(has_bfd_iberty_z),y)
  523. EXTLIBS += -lbfd -liberty -lz
  524. else
  525. FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty
  526. has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE))
  527. ifeq ($(has_cplus_demangle),y)
  528. EXTLIBS += -liberty
  529. BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
  530. else
  531. msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
  532. BASIC_CFLAGS += -DNO_DEMANGLE
  533. endif
  534. endif
  535. endif
  536. endif
  537. endif
  538. endif
  539. ifdef NO_STRLCPY
  540. BASIC_CFLAGS += -DNO_STRLCPY
  541. else
  542. ifneq ($(call try-cc,$(SOURCE_STRLCPY),),y)
  543. BASIC_CFLAGS += -DNO_STRLCPY
  544. endif
  545. endif
  546. ifneq ($(findstring $(MAKEFLAGS),s),s)
  547. ifndef V
  548. QUIET_CC = @echo ' ' CC $@;
  549. QUIET_AR = @echo ' ' AR $@;
  550. QUIET_LINK = @echo ' ' LINK $@;
  551. QUIET_MKDIR = @echo ' ' MKDIR $@;
  552. QUIET_GEN = @echo ' ' GEN $@;
  553. endif
  554. endif
  555. ifdef ASCIIDOC8
  556. export ASCIIDOC8
  557. endif
  558. # Shell quote (do not use $(call) to accommodate ancient setups);
  559. ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
  560. DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  561. bindir_SQ = $(subst ','\'',$(bindir))
  562. bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
  563. mandir_SQ = $(subst ','\'',$(mandir))
  564. infodir_SQ = $(subst ','\'',$(infodir))
  565. perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
  566. template_dir_SQ = $(subst ','\'',$(template_dir))
  567. htmldir_SQ = $(subst ','\'',$(htmldir))
  568. prefix_SQ = $(subst ','\'',$(prefix))
  569. SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
  570. LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
  571. ALL_CFLAGS += $(BASIC_CFLAGS)
  572. ALL_CFLAGS += $(ARCH_CFLAGS)
  573. ALL_LDFLAGS += $(BASIC_LDFLAGS)
  574. export INSTALL SHELL_PATH
  575. ### Build rules
  576. SHELL = $(SHELL_PATH)
  577. all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
  578. please_set_SHELL_PATH_to_a_more_modern_shell:
  579. @$$(:)
  580. shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
  581. strip: $(PROGRAMS) $(OUTPUT)perf
  582. $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
  583. $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
  584. $(QUIET_CC)$(CC) -DPERF_VERSION='"$(PERF_VERSION)"' \
  585. '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
  586. $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
  587. $(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
  588. $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
  589. $(BUILTIN_OBJS) $(LIBS) -o $@
  590. $(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
  591. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
  592. '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
  593. '-DPERF_MAN_PATH="$(mandir_SQ)"' \
  594. '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
  595. $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
  596. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
  597. '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
  598. '-DPERF_MAN_PATH="$(mandir_SQ)"' \
  599. '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
  600. $(OUTPUT)common-cmds.h: util/generate-cmdlist.sh command-list.txt
  601. $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
  602. $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
  603. $(SCRIPTS) : % : %.sh
  604. $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
  605. # These can record PERF_VERSION
  606. $(OUTPUT)perf.o perf.spec \
  607. $(SCRIPTS) \
  608. : $(OUTPUT)PERF-VERSION-FILE
  609. $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
  610. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
  611. $(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
  612. $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
  613. $(OUTPUT)%.o: %.S
  614. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
  615. $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
  616. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
  617. '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
  618. '-DBINDIR="$(bindir_relative_SQ)"' \
  619. '-DPREFIX="$(prefix_SQ)"' \
  620. $<
  621. $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
  622. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
  623. $(OUTPUT)util/ui/browser.o: util/ui/browser.c $(OUTPUT)PERF-CFLAGS
  624. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
  625. $(OUTPUT)util/ui/browsers/annotate.o: util/ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
  626. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
  627. $(OUTPUT)util/ui/browsers/hists.o: util/ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
  628. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
  629. $(OUTPUT)util/ui/browsers/map.o: util/ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
  630. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
  631. $(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
  632. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
  633. $(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
  634. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
  635. $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
  636. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
  637. $(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
  638. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
  639. $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
  640. $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
  641. $(OUTPUT)perf-%: %.o $(PERFLIBS)
  642. $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  643. $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
  644. $(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
  645. # we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
  646. # we depend the various files onto their directories.
  647. DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
  648. $(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
  649. # In the second step, we make a rule to actually create these directories
  650. $(sort $(dir $(DIRECTORY_DEPS))):
  651. $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null
  652. $(LIB_FILE): $(LIB_OBJS)
  653. $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
  654. help:
  655. @echo 'Perf make targets:'
  656. @echo ' doc - make *all* documentation (see below)'
  657. @echo ' man - make manpage documentation (access with man <foo>)'
  658. @echo ' html - make html documentation'
  659. @echo ' info - make GNU info documentation (access with info <foo>)'
  660. @echo ' pdf - make pdf documentation'
  661. @echo ' TAGS - use etags to make tag information for source browsing'
  662. @echo ' tags - use ctags to make tag information for source browsing'
  663. @echo ' cscope - use cscope to make interactive browsing database'
  664. @echo ''
  665. @echo 'Perf install targets:'
  666. @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed'
  667. @echo ' HINT: use "make prefix=<path> <install target>" to install to a particular'
  668. @echo ' path like make prefix=/usr/local install install-doc'
  669. @echo ' install - install compiled binaries'
  670. @echo ' install-doc - install *all* documentation'
  671. @echo ' install-man - install manpage documentation'
  672. @echo ' install-html - install html documentation'
  673. @echo ' install-info - install GNU info documentation'
  674. @echo ' install-pdf - install pdf documentation'
  675. @echo ''
  676. @echo ' quick-install-doc - alias for quick-install-man'
  677. @echo ' quick-install-man - install the documentation quickly'
  678. @echo ' quick-install-html - install the html documentation quickly'
  679. @echo ''
  680. @echo 'Perf maintainer targets:'
  681. @echo ' distclean - alias to clean'
  682. @echo ' clean - clean all binary objects and build output'
  683. doc:
  684. $(MAKE) -C Documentation all
  685. man:
  686. $(MAKE) -C Documentation man
  687. html:
  688. $(MAKE) -C Documentation html
  689. info:
  690. $(MAKE) -C Documentation info
  691. pdf:
  692. $(MAKE) -C Documentation pdf
  693. TAGS:
  694. $(RM) TAGS
  695. $(FIND) . -name '*.[hcS]' -print | xargs etags -a
  696. tags:
  697. $(RM) tags
  698. $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
  699. cscope:
  700. $(RM) cscope*
  701. $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
  702. ### Detect prefix changes
  703. TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
  704. $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
  705. $(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
  706. @FLAGS='$(TRACK_CFLAGS)'; \
  707. if test x"$$FLAGS" != x"`cat $(OUTPUT)PERF-CFLAGS 2>/dev/null`" ; then \
  708. echo 1>&2 " * new build flags or prefix"; \
  709. echo "$$FLAGS" >$(OUTPUT)PERF-CFLAGS; \
  710. fi
  711. ### Testing rules
  712. # GNU make supports exporting all variables by "export" without parameters.
  713. # However, the environment gets quite big, and some programs have problems
  714. # with that.
  715. check: $(OUTPUT)common-cmds.h
  716. if sparse; \
  717. then \
  718. for i in *.c */*.c; \
  719. do \
  720. sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
  721. done; \
  722. else \
  723. exit 1; \
  724. fi
  725. ### Installation rules
  726. ifneq ($(filter /%,$(firstword $(perfexecdir))),)
  727. perfexec_instdir = $(perfexecdir)
  728. else
  729. perfexec_instdir = $(prefix)/$(perfexecdir)
  730. endif
  731. perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
  732. install: all
  733. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
  734. $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
  735. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
  736. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
  737. $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
  738. $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
  739. $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
  740. $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
  741. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
  742. $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
  743. $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'
  744. $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
  745. $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
  746. install-python_ext:
  747. $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
  748. install-doc:
  749. $(MAKE) -C Documentation install
  750. install-man:
  751. $(MAKE) -C Documentation install-man
  752. install-html:
  753. $(MAKE) -C Documentation install-html
  754. install-info:
  755. $(MAKE) -C Documentation install-info
  756. install-pdf:
  757. $(MAKE) -C Documentation install-pdf
  758. quick-install-doc:
  759. $(MAKE) -C Documentation quick-install
  760. quick-install-man:
  761. $(MAKE) -C Documentation quick-install-man
  762. quick-install-html:
  763. $(MAKE) -C Documentation quick-install-html
  764. ### Cleaning rules
  765. clean:
  766. $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
  767. $(RM) $(ALL_PROGRAMS) perf
  768. $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
  769. $(MAKE) -C Documentation/ clean
  770. $(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
  771. $(python-clean)
  772. .PHONY: all install clean strip
  773. .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
  774. .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS