Makefile 29 KB

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