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