xref: /openbmc/linux/tools/perf/util/Build (revision e6e8c6c2)
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
146
147perf-$(CONFIG_LIBBPF) += bpf-loader.o
148perf-$(CONFIG_LIBBPF) += bpf_map.o
149perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o
150perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter_cgroup.o
151perf-$(CONFIG_PERF_BPF_SKEL) += bpf_ftrace.o
152perf-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o
153perf-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork.o
154perf-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o
155perf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
156perf-$(CONFIG_LIBELF) += symbol-elf.o
157perf-$(CONFIG_LIBELF) += probe-file.o
158perf-$(CONFIG_LIBELF) += probe-event.o
159
160ifdef CONFIG_LIBBPF_DYNAMIC
161  hashmap := 1
162endif
163ifndef CONFIG_LIBBPF
164  hashmap := 1
165endif
166
167ifdef hashmap
168perf-y += hashmap.o
169endif
170
171ifndef CONFIG_LIBELF
172perf-y += symbol-minimal.o
173endif
174
175ifndef CONFIG_SETNS
176perf-y += setns.o
177endif
178
179perf-$(CONFIG_DWARF) += probe-finder.o
180perf-$(CONFIG_DWARF) += dwarf-aux.o
181perf-$(CONFIG_DWARF) += dwarf-regs.o
182
183perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
184perf-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind-local.o
185perf-$(CONFIG_LIBUNWIND)          += unwind-libunwind.o
186perf-$(CONFIG_LIBUNWIND_X86)      += libunwind/x86_32.o
187perf-$(CONFIG_LIBUNWIND_AARCH64)  += libunwind/arm64.o
188
189perf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
190perf-y += data-convert-json.o
191
192perf-y += scripting-engines/
193
194perf-$(CONFIG_ZLIB) += zlib.o
195perf-$(CONFIG_LZMA) += lzma.o
196perf-$(CONFIG_ZSTD) += zstd.o
197
198perf-$(CONFIG_LIBCAP) += cap.o
199
200perf-y += demangle-ocaml.o
201perf-y += demangle-java.o
202perf-y += demangle-rust.o
203
204ifdef CONFIG_JITDUMP
205perf-$(CONFIG_LIBELF) += jitdump.o
206perf-$(CONFIG_LIBELF) += genelf.o
207perf-$(CONFIG_DWARF) += genelf_debug.o
208endif
209
210perf-y += perf-hooks.o
211
212perf-$(CONFIG_LIBBPF) += bpf-event.o
213perf-$(CONFIG_LIBBPF) += bpf-utils.o
214
215perf-$(CONFIG_CXX) += c++/
216
217perf-$(CONFIG_LIBPFM4) += pfm.o
218
219CFLAGS_config.o   += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
220CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
221
222# avoid compiler warnings in 32-bit mode
223CFLAGS_genelf_debug.o  += -Wno-packed
224
225$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
226	$(call rule_mkdir)
227	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
228		--header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) $<
229
230$(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y
231	$(call rule_mkdir)
232	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
233		-o $(OUTPUT)util/parse-events-bison.c -p parse_events_
234
235$(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c
236	$(call rule_mkdir)
237	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/expr-flex.c \
238		--header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) $<
239
240$(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y
241	$(call rule_mkdir)
242	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
243		-o $(OUTPUT)util/expr-bison.c -p expr_
244
245$(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c
246	$(call rule_mkdir)
247	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/pmu-flex.c \
248		--header-file=$(OUTPUT)util/pmu-flex.h $(PARSER_DEBUG_FLEX) $<
249
250$(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y
251	$(call rule_mkdir)
252	$(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \
253		-o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
254
255FLEX_GE_26 := $(shell expr $(shell $(FLEX) --version | sed -e  's/flex \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 26)
256ifeq ($(FLEX_GE_26),1)
257  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
258  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 $$?)
259  ifeq ($(CC_HASNT_MISLEADING_INDENTATION), 1)
260    flex_flags += -Wno-misleading-indentation
261  endif
262else
263  flex_flags := -w
264endif
265CFLAGS_parse-events-flex.o  += $(flex_flags)
266CFLAGS_pmu-flex.o           += $(flex_flags)
267CFLAGS_expr-flex.o          += $(flex_flags)
268
269bison_flags := -DYYENABLE_NLS=0
270BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35)
271ifeq ($(BISON_GE_35),1)
272  bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum
273else
274  bison_flags += -w
275endif
276CFLAGS_parse-events-bison.o += $(bison_flags)
277CFLAGS_pmu-bison.o          += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
278CFLAGS_expr-bison.o         += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
279
280$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
281$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
282$(OUTPUT)util/expr.o: $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-bison.c
283
284CFLAGS_bitmap.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
285CFLAGS_find_bit.o      += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
286CFLAGS_rbtree.o        += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
287CFLAGS_libstring.o     += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
288CFLAGS_hweight.o       += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
289CFLAGS_parse-events.o  += -Wno-redundant-decls
290CFLAGS_expr.o          += -Wno-redundant-decls
291CFLAGS_header.o        += -include $(OUTPUT)PERF-VERSION-FILE
292CFLAGS_arm-spe.o       += -I$(srctree)/tools/arch/arm64/include/
293
294$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
295	$(call rule_mkdir)
296	$(call if_changed_dep,cc_o_c)
297
298$(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE
299	$(call rule_mkdir)
300	$(call if_changed_dep,cc_o_c)
301
302$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE
303	$(call rule_mkdir)
304	$(call if_changed_dep,cc_o_c)
305
306$(OUTPUT)util/ctype.o: ../lib/ctype.c FORCE
307	$(call rule_mkdir)
308	$(call if_changed_dep,cc_o_c)
309
310$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE
311	$(call rule_mkdir)
312	$(call if_changed_dep,cc_o_c)
313
314$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE
315	$(call rule_mkdir)
316	$(call if_changed_dep,cc_o_c)
317
318$(OUTPUT)util/libstring.o: ../lib/string.c FORCE
319	$(call rule_mkdir)
320	$(call if_changed_dep,cc_o_c)
321
322$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE
323	$(call rule_mkdir)
324	$(call if_changed_dep,cc_o_c)
325
326$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE
327	$(call rule_mkdir)
328	$(call if_changed_dep,cc_o_c)
329
330$(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE
331	$(call rule_mkdir)
332	$(call if_changed_dep,cc_o_c)
333