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