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