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