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