xref: /openbmc/linux/tools/perf/util/Build (revision 34bec35c)
1perf-y += arm64-frame-pointer-unwind-support.o
2perf-y += annotate.o
3perf-y += block-info.o
4perf-y += block-range.o
5perf-y += build-id.o
6perf-y += cacheline.o
7perf-y += config.o
8perf-y += copyfile.o
9perf-y += ctype.o
10perf-y += db-export.o
11perf-y += env.o
12perf-y += event.o
13perf-y += evlist.o
14perf-y += evlist-hybrid.o
15perf-y += sideband_evlist.o
16perf-y += evsel.o
17perf-y += evsel_fprintf.o
18perf-y += perf_event_attr_fprintf.o
19perf-y += evswitch.o
20perf-y += find_bit.o
21perf-y += get_current_dir_name.o
22perf-y += kallsyms.o
23perf-y += levenshtein.o
24perf-y += llvm-utils.o
25perf-y += mmap.o
26perf-y += memswap.o
27perf-y += parse-events.o
28perf-y += parse-events-hybrid.o
29perf-y += print-events.o
30perf-y += tracepoint.o
31perf-y += perf_regs.o
32perf-y += path.o
33perf-y += print_binary.o
34perf-y += rlimit.o
35perf-y += argv_split.o
36perf-y += rbtree.o
37perf-y += libstring.o
38perf-y += bitmap.o
39perf-y += hweight.o
40perf-y += smt.o
41perf-y += strbuf.o
42perf-y += string.o
43perf-y += strlist.o
44perf-y += strfilter.o
45perf-y += top.o
46perf-y += usage.o
47perf-y += dso.o
48perf-y += dsos.o
49perf-y += symbol.o
50perf-y += symbol_fprintf.o
51perf-y += color.o
52perf-y += color_config.o
53perf-y += metricgroup.o
54perf-y += header.o
55perf-y += callchain.o
56perf-y += values.o
57perf-y += debug.o
58perf-y += fncache.o
59perf-y += machine.o
60perf-y += map.o
61perf-y += maps.o
62perf-y += pstack.o
63perf-y += session.o
64perf-y += sample-raw.o
65perf-y += s390-sample-raw.o
66perf-y += amd-sample-raw.o
67perf-$(CONFIG_TRACE) += syscalltbl.o
68perf-y += ordered-events.o
69perf-y += namespaces.o
70perf-y += comm.o
71perf-y += thread.o
72perf-y += thread_map.o
73perf-y += trace-event-parse.o
74perf-y += parse-events-flex.o
75perf-y += parse-events-bison.o
76perf-y += pmu.o
77perf-y += pmu-flex.o
78perf-y += pmu-bison.o
79perf-y += pmu-hybrid.o
80perf-y += trace-event-read.o
81perf-y += trace-event-info.o
82perf-y += trace-event-scripting.o
83perf-y += trace-event.o
84perf-y += svghelper.o
85perf-y += sort.o
86perf-y += hist.o
87perf-y += util.o
88perf-y += cpumap.o
89perf-y += affinity.o
90perf-y += cputopo.o
91perf-y += cgroup.o
92perf-y += target.o
93perf-y += rblist.o
94perf-y += intlist.o
95perf-y += vdso.o
96perf-y += counts.o
97perf-y += stat.o
98perf-y += stat-shadow.o
99perf-y += stat-display.o
100perf-y += perf_api_probe.o
101perf-y += record.o
102perf-y += srcline.o
103perf-y += srccode.o
104perf-y += synthetic-events.o
105perf-y += data.o
106perf-y += tsc.o
107perf-y += cloexec.o
108perf-y += call-path.o
109perf-y += rwsem.o
110perf-y += thread-stack.o
111perf-y += spark.o
112perf-y += topdown.o
113perf-y += iostat.o
114perf-y += stream.o
115perf-$(CONFIG_AUXTRACE) += auxtrace.o
116perf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
117perf-$(CONFIG_AUXTRACE) += intel-pt.o
118perf-$(CONFIG_AUXTRACE) += intel-bts.o
119perf-$(CONFIG_AUXTRACE) += arm-spe.o
120perf-$(CONFIG_AUXTRACE) += arm-spe-decoder/
121perf-$(CONFIG_AUXTRACE) += s390-cpumsf.o
122
123ifdef CONFIG_LIBOPENCSD
124perf-$(CONFIG_AUXTRACE) += cs-etm.o
125perf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
126endif
127
128perf-y += parse-branch-options.o
129perf-y += dump-insn.o
130perf-y += parse-regs-options.o
131perf-y += parse-sublevel-options.o
132perf-y += term.o
133perf-y += help-unknown-cmd.o
134perf-y += dlfilter.o
135perf-y += mem-events.o
136perf-y += vsprintf.o
137perf-y += units.o
138perf-y += time-utils.o
139perf-y += expr-flex.o
140perf-y += expr-bison.o
141perf-y += expr.o
142perf-y += branch.o
143perf-y += mem2node.o
144perf-y += clockid.o
145perf-y += list_sort.o
146perf-y += mutex.o
147
148perf-$(CONFIG_LIBBPF) += bpf-loader.o
149perf-$(CONFIG_LIBBPF) += bpf_map.o
150perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o
151perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter_cgroup.o
152perf-$(CONFIG_PERF_BPF_SKEL) += bpf_ftrace.o
153perf-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o
154perf-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork.o
155perf-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o
156perf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
157perf-$(CONFIG_LIBELF) += symbol-elf.o
158perf-$(CONFIG_LIBELF) += probe-file.o
159perf-$(CONFIG_LIBELF) += probe-event.o
160
161ifdef CONFIG_LIBBPF_DYNAMIC
162  hashmap := 1
163endif
164ifndef CONFIG_LIBBPF
165  hashmap := 1
166endif
167
168ifdef hashmap
169perf-y += hashmap.o
170endif
171
172ifndef CONFIG_LIBELF
173perf-y += symbol-minimal.o
174endif
175
176ifndef CONFIG_SETNS
177perf-y += setns.o
178endif
179
180perf-$(CONFIG_DWARF) += probe-finder.o
181perf-$(CONFIG_DWARF) += dwarf-aux.o
182perf-$(CONFIG_DWARF) += dwarf-regs.o
183
184perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
185perf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind-local.o
186perf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
187perf-$(CONFIG_LIBUNWIND_X86)      += libunwind/x86_32.o
188perf-$(CONFIG_LIBUNWIND_AARCH64)  += libunwind/arm64.o
189
190perf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
191perf-y += data-convert-json.o
192
193perf-y += scripting-engines/
194
195perf-$(CONFIG_ZLIB) += zlib.o
196perf-$(CONFIG_LZMA) += lzma.o
197perf-$(CONFIG_ZSTD) += zstd.o
198
199perf-$(CONFIG_LIBCAP) += cap.o
200
201perf-y += demangle-ocaml.o
202perf-y += demangle-java.o
203perf-y += demangle-rust.o
204
205ifdef CONFIG_JITDUMP
206perf-$(CONFIG_LIBELF) += jitdump.o
207perf-$(CONFIG_LIBELF) += genelf.o
208perf-$(CONFIG_DWARF) += genelf_debug.o
209endif
210
211perf-y += perf-hooks.o
212
213perf-$(CONFIG_LIBBPF) += bpf-event.o
214perf-$(CONFIG_LIBBPF) += bpf-utils.o
215
216perf-$(CONFIG_CXX) += c++/
217
218perf-$(CONFIG_LIBPFM4) += pfm.o
219
220CFLAGS_config.o   += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
221CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
222
223# avoid compiler warnings in 32-bit mode
224CFLAGS_genelf_debug.o  += -Wno-packed
225
226$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
227	$(call rule_mkdir)
228	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
229		--header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) $<
230
231$(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y
232	$(call rule_mkdir)
233	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
234		-o $(OUTPUT)util/parse-events-bison.c -p parse_events_
235
236$(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c
237	$(call rule_mkdir)
238	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/expr-flex.c \
239		--header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) $<
240
241$(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y
242	$(call rule_mkdir)
243	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
244		-o $(OUTPUT)util/expr-bison.c -p expr_
245
246$(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c
247	$(call rule_mkdir)
248	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/pmu-flex.c \
249		--header-file=$(OUTPUT)util/pmu-flex.h $(PARSER_DEBUG_FLEX) $<
250
251$(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y
252	$(call rule_mkdir)
253	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
254		-o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
255
256FLEX_GE_26 := $(shell expr $(shell $(FLEX) --version | sed -e  's/flex \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 26)
257ifeq ($(FLEX_GE_26),1)
258  flex_flags := -Wno-switch-enum -Wno-switch-default -Wno-unused-function -Wno-redundant-decls -Wno-sign-compare -Wno-unused-parameter -Wno-missing-prototypes -Wno-missing-declarations
259  CC_HASNT_MISLEADING_INDENTATION := $(shell echo "int main(void) { return 0 }" | $(CC) -Werror -Wno-misleading-indentation -o /dev/null -xc - 2>&1 | grep -q -- -Wno-misleading-indentation ; echo $$?)
260  ifeq ($(CC_HASNT_MISLEADING_INDENTATION), 1)
261    flex_flags += -Wno-misleading-indentation
262  endif
263else
264  flex_flags := -w
265endif
266CFLAGS_parse-events-flex.o  += $(flex_flags)
267CFLAGS_pmu-flex.o           += $(flex_flags)
268CFLAGS_expr-flex.o          += $(flex_flags)
269
270bison_flags := -DYYENABLE_NLS=0
271BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35)
272ifeq ($(BISON_GE_35),1)
273  bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum -Wno-unused-but-set-variable -Wno-unknown-warning-option
274else
275  bison_flags += -w
276endif
277CFLAGS_parse-events-bison.o += $(bison_flags)
278CFLAGS_pmu-bison.o          += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
279CFLAGS_expr-bison.o         += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
280
281$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
282$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
283$(OUTPUT)util/expr.o: $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-bison.c
284
285CFLAGS_bitmap.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
286CFLAGS_find_bit.o      += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
287CFLAGS_rbtree.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
288CFLAGS_libstring.o     += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
289CFLAGS_hweight.o       += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
290CFLAGS_parse-events.o  += -Wno-redundant-decls
291CFLAGS_expr.o          += -Wno-redundant-decls
292CFLAGS_header.o        += -include $(OUTPUT)PERF-VERSION-FILE
293CFLAGS_arm-spe.o       += -I$(srctree)/tools/arch/arm64/include/
294
295$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
296	$(call rule_mkdir)
297	$(call if_changed_dep,cc_o_c)
298
299$(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE
300	$(call rule_mkdir)
301	$(call if_changed_dep,cc_o_c)
302
303$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE
304	$(call rule_mkdir)
305	$(call if_changed_dep,cc_o_c)
306
307$(OUTPUT)util/ctype.o: ../lib/ctype.c FORCE
308	$(call rule_mkdir)
309	$(call if_changed_dep,cc_o_c)
310
311$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE
312	$(call rule_mkdir)
313	$(call if_changed_dep,cc_o_c)
314
315$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE
316	$(call rule_mkdir)
317	$(call if_changed_dep,cc_o_c)
318
319$(OUTPUT)util/libstring.o: ../lib/string.c FORCE
320	$(call rule_mkdir)
321	$(call if_changed_dep,cc_o_c)
322
323$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE
324	$(call rule_mkdir)
325	$(call if_changed_dep,cc_o_c)
326
327$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE
328	$(call rule_mkdir)
329	$(call if_changed_dep,cc_o_c)
330
331$(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE
332	$(call rule_mkdir)
333	$(call if_changed_dep,cc_o_c)
334