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