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