xref: /linux/tools/perf/util/Build (revision e9f0878c4b2004ac19581274c1ae4c61ae3ca70e)
1libperf-y += annotate.o
2libperf-y += block-range.o
3libperf-y += build-id.o
4libperf-y += config.o
5libperf-y += ctype.o
6libperf-y += db-export.o
7libperf-y += env.o
8libperf-y += event.o
9libperf-y += evlist.o
10libperf-y += evsel.o
11libperf-y += evsel_fprintf.o
12libperf-y += find_bit.o
13libperf-y += kallsyms.o
14libperf-y += levenshtein.o
15libperf-y += llvm-utils.o
16libperf-y += mmap.o
17libperf-y += memswap.o
18libperf-y += parse-events.o
19libperf-y += perf_regs.o
20libperf-y += path.o
21libperf-y += print_binary.o
22libperf-y += rbtree.o
23libperf-y += libstring.o
24libperf-y += bitmap.o
25libperf-y += hweight.o
26libperf-y += smt.o
27libperf-y += strbuf.o
28libperf-y += string.o
29libperf-y += strlist.o
30libperf-y += strfilter.o
31libperf-y += top.o
32libperf-y += usage.o
33libperf-y += dso.o
34libperf-y += symbol.o
35libperf-y += symbol_fprintf.o
36libperf-y += color.o
37libperf-y += metricgroup.o
38libperf-y += header.o
39libperf-y += callchain.o
40libperf-y += values.o
41libperf-y += debug.o
42libperf-y += machine.o
43libperf-y += map.o
44libperf-y += pstack.o
45libperf-y += session.o
46libperf-$(CONFIG_TRACE) += syscalltbl.o
47libperf-y += ordered-events.o
48libperf-y += namespaces.o
49libperf-y += comm.o
50libperf-y += thread.o
51libperf-y += thread_map.o
52libperf-y += trace-event-parse.o
53libperf-y += parse-events-flex.o
54libperf-y += parse-events-bison.o
55libperf-y += pmu.o
56libperf-y += pmu-flex.o
57libperf-y += pmu-bison.o
58libperf-y += trace-event-read.o
59libperf-y += trace-event-info.o
60libperf-y += trace-event-scripting.o
61libperf-y += trace-event.o
62libperf-y += svghelper.o
63libperf-y += sort.o
64libperf-y += hist.o
65libperf-y += util.o
66libperf-y += xyarray.o
67libperf-y += cpumap.o
68libperf-y += cgroup.o
69libperf-y += target.o
70libperf-y += rblist.o
71libperf-y += intlist.o
72libperf-y += vdso.o
73libperf-y += counts.o
74libperf-y += stat.o
75libperf-y += stat-shadow.o
76libperf-y += record.o
77libperf-y += srcline.o
78libperf-y += data.o
79libperf-y += tsc.o
80libperf-y += cloexec.o
81libperf-y += call-path.o
82libperf-y += rwsem.o
83libperf-y += thread-stack.o
84libperf-$(CONFIG_AUXTRACE) += auxtrace.o
85libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
86libperf-$(CONFIG_AUXTRACE) += intel-pt.o
87libperf-$(CONFIG_AUXTRACE) += intel-bts.o
88libperf-$(CONFIG_AUXTRACE) += arm-spe.o
89libperf-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o
90libperf-$(CONFIG_AUXTRACE) += s390-cpumsf.o
91
92ifdef CONFIG_LIBOPENCSD
93libperf-$(CONFIG_AUXTRACE) += cs-etm.o
94libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
95endif
96
97libperf-y += parse-branch-options.o
98libperf-y += dump-insn.o
99libperf-y += parse-regs-options.o
100libperf-y += term.o
101libperf-y += help-unknown-cmd.o
102libperf-y += mem-events.o
103libperf-y += vsprintf.o
104libperf-y += drv_configs.o
105libperf-y += units.o
106libperf-y += time-utils.o
107libperf-y += expr-bison.o
108libperf-y += branch.o
109libperf-y += mem2node.o
110
111libperf-$(CONFIG_LIBBPF) += bpf-loader.o
112libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
113libperf-$(CONFIG_LIBELF) += symbol-elf.o
114libperf-$(CONFIG_LIBELF) += probe-file.o
115libperf-$(CONFIG_LIBELF) += probe-event.o
116
117ifndef CONFIG_LIBELF
118libperf-y += symbol-minimal.o
119endif
120
121ifndef CONFIG_SETNS
122libperf-y += setns.o
123endif
124
125libperf-$(CONFIG_DWARF) += probe-finder.o
126libperf-$(CONFIG_DWARF) += dwarf-aux.o
127libperf-$(CONFIG_DWARF) += dwarf-regs.o
128
129libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
130libperf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind-local.o
131libperf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
132libperf-$(CONFIG_LIBUNWIND_X86)      += libunwind/x86_32.o
133libperf-$(CONFIG_LIBUNWIND_AARCH64)  += libunwind/arm64.o
134
135libperf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
136
137libperf-y += scripting-engines/
138
139libperf-$(CONFIG_ZLIB) += zlib.o
140libperf-$(CONFIG_LZMA) += lzma.o
141libperf-y += demangle-java.o
142libperf-y += demangle-rust.o
143
144ifdef CONFIG_JITDUMP
145libperf-$(CONFIG_LIBELF) += jitdump.o
146libperf-$(CONFIG_LIBELF) += genelf.o
147libperf-$(CONFIG_DWARF) += genelf_debug.o
148endif
149
150libperf-y += perf-hooks.o
151
152libperf-$(CONFIG_CXX) += c++/
153
154CFLAGS_config.o   += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
155CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
156
157# avoid compiler warnings in 32-bit mode
158CFLAGS_genelf_debug.o  += -Wno-packed
159
160$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
161	$(call rule_mkdir)
162	$(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
163
164$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
165	$(call rule_mkdir)
166	$(Q)$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $@ -p parse_events_
167
168$(OUTPUT)util/expr-bison.c: util/expr.y
169	$(call rule_mkdir)
170	$(Q)$(call echo-cmd,bison)$(BISON) -v util/expr.y -d $(PARSER_DEBUG_BISON) -o $@ -p expr__
171
172$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
173	$(call rule_mkdir)
174	$(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
175
176$(OUTPUT)util/pmu-bison.c: util/pmu.y
177	$(call rule_mkdir)
178	$(Q)$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $@ -p perf_pmu_
179
180CFLAGS_parse-events-flex.o  += -w
181CFLAGS_pmu-flex.o           += -w
182CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
183CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
184CFLAGS_expr-bison.o         += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
185
186$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
187$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
188
189CFLAGS_bitmap.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
190CFLAGS_find_bit.o      += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
191CFLAGS_rbtree.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
192CFLAGS_libstring.o     += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
193CFLAGS_hweight.o       += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
194CFLAGS_parse-events.o  += -Wno-redundant-decls
195CFLAGS_header.o        += -include $(OUTPUT)PERF-VERSION-FILE
196
197$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
198	$(call rule_mkdir)
199	$(call if_changed_dep,cc_o_c)
200
201$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE
202	$(call rule_mkdir)
203	$(call if_changed_dep,cc_o_c)
204
205$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE
206	$(call rule_mkdir)
207	$(call if_changed_dep,cc_o_c)
208
209$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE
210	$(call rule_mkdir)
211	$(call if_changed_dep,cc_o_c)
212
213$(OUTPUT)util/libstring.o: ../lib/string.c FORCE
214	$(call rule_mkdir)
215	$(call if_changed_dep,cc_o_c)
216
217$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE
218	$(call rule_mkdir)
219	$(call if_changed_dep,cc_o_c)
220
221$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE
222	$(call rule_mkdir)
223	$(call if_changed_dep,cc_o_c)
224