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