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