1878460e8SArnaldo Carvalho de Meloinclude $(srctree)/tools/scripts/Makefile.include 210c775afSIan Rogersinclude $(srctree)/tools/scripts/utilities.mak 310c775afSIan Rogers 407b972ffSIan Rogersperf-util-y += annotate-arch/ 5e467705aSIan Rogersperf-util-y += arm64-frame-pointer-unwind-support.o 6257046a3SIan Rogersperf-util-y += addr2line.o 7e467705aSIan Rogersperf-util-y += addr_location.o 8e467705aSIan Rogersperf-util-y += annotate.o 98d3b6649SEric Biggersperf-util-y += blake2s.o 10e467705aSIan Rogersperf-util-y += block-info.o 11e467705aSIan Rogersperf-util-y += block-range.o 12e467705aSIan Rogersperf-util-y += build-id.o 13e467705aSIan Rogersperf-util-y += cacheline.o 14b5c9bcdeSIan Rogersperf-util-$(CONFIG_LIBCAPSTONE) += capstone.o 15e467705aSIan Rogersperf-util-y += config.o 16e467705aSIan Rogersperf-util-y += copyfile.o 17e467705aSIan Rogersperf-util-y += ctype.o 18e467705aSIan Rogersperf-util-y += db-export.o 19e467705aSIan Rogersperf-util-y += disasm.o 20e467705aSIan Rogersperf-util-y += env.o 21e467705aSIan Rogersperf-util-y += event.o 22e467705aSIan Rogersperf-util-y += evlist.o 23e467705aSIan Rogersperf-util-y += sideband_evlist.o 24e467705aSIan Rogersperf-util-y += evsel.o 25e467705aSIan Rogersperf-util-y += evsel_fprintf.o 26e467705aSIan Rogersperf-util-y += perf_event_attr_fprintf.o 27e467705aSIan Rogersperf-util-y += evswitch.o 28e467705aSIan Rogersperf-util-y += find_bit.o 29e467705aSIan Rogersperf-util-y += levenshtein.o 3095931d9aSIan Rogersperf-util-$(CONFIG_LIBBFD) += libbfd.o 31d9007afcSIan Rogersperf-util-y += llvm.o 32e467705aSIan Rogersperf-util-y += mmap.o 33e467705aSIan Rogersperf-util-y += memswap.o 34e467705aSIan Rogersperf-util-y += parse-events.o 35e467705aSIan Rogersperf-util-y += print-events.o 36e467705aSIan Rogersperf-util-y += tracepoint.o 37e467705aSIan Rogersperf-util-y += perf_regs.o 38e467705aSIan Rogersperf-util-y += perf-regs-arch/ 39e467705aSIan Rogersperf-util-y += path.o 40e467705aSIan Rogersperf-util-y += print_binary.o 41e467705aSIan Rogersperf-util-y += print_insn.o 42e467705aSIan Rogersperf-util-y += rlimit.o 43e467705aSIan Rogersperf-util-y += argv_split.o 44e467705aSIan Rogersperf-util-y += rbtree.o 45e467705aSIan Rogersperf-util-y += libstring.o 46e467705aSIan Rogersperf-util-y += bitmap.o 47e467705aSIan Rogersperf-util-y += hweight.o 48e467705aSIan Rogersperf-util-y += smt.o 49e467705aSIan Rogersperf-util-y += strbuf.o 50e467705aSIan Rogersperf-util-y += string.o 51e467705aSIan Rogersperf-util-y += strlist.o 52e467705aSIan Rogersperf-util-y += strfilter.o 53e467705aSIan Rogersperf-util-y += top.o 54e467705aSIan Rogersperf-util-y += usage.o 55e467705aSIan Rogersperf-util-y += dso.o 56e467705aSIan Rogersperf-util-y += dsos.o 57e467705aSIan Rogersperf-util-y += symbol.o 58e467705aSIan Rogersperf-util-y += symbol_fprintf.o 59e467705aSIan Rogersperf-util-y += map_symbol.o 60e467705aSIan Rogersperf-util-y += color.o 61e467705aSIan Rogersperf-util-y += color_config.o 62e467705aSIan Rogersperf-util-y += metricgroup.o 63e467705aSIan Rogersperf-util-y += header.o 64e467705aSIan Rogersperf-util-y += callchain.o 65e467705aSIan Rogersperf-util-y += values.o 66e467705aSIan Rogersperf-util-y += debug.o 67e467705aSIan Rogersperf-util-y += fncache.o 68e467705aSIan Rogersperf-util-y += machine.o 69e467705aSIan Rogersperf-util-y += map.o 70e467705aSIan Rogersperf-util-y += maps.o 71e467705aSIan Rogersperf-util-y += pstack.o 72e467705aSIan Rogersperf-util-y += session.o 73564e5cbcSIan Rogersperf-util-y += tool.o 74dc6d2bc2SIan Rogersperf-util-y += sample.o 75e467705aSIan Rogersperf-util-y += sample-raw.o 76e467705aSIan Rogersperf-util-y += s390-sample-raw.o 77e467705aSIan Rogersperf-util-y += amd-sample-raw.o 78e467705aSIan Rogersperf-util-$(CONFIG_TRACE) += syscalltbl.o 79e467705aSIan Rogersperf-util-y += ordered-events.o 80e467705aSIan Rogersperf-util-y += namespaces.o 81e467705aSIan Rogersperf-util-y += comm.o 82e467705aSIan Rogersperf-util-y += thread.o 83e467705aSIan Rogersperf-util-y += threads.o 84e467705aSIan Rogersperf-util-y += thread_map.o 85e467705aSIan Rogersperf-util-y += parse-events-flex.o 86e467705aSIan Rogersperf-util-y += parse-events-bison.o 87e467705aSIan Rogersperf-util-y += pmu.o 88e467705aSIan Rogersperf-util-y += pmus.o 89e467705aSIan Rogersperf-util-y += pmu-flex.o 90e467705aSIan Rogersperf-util-y += pmu-bison.o 9128917cb1SIan Rogersperf-util-y += drm_pmu.o 924810b761SIan Rogersperf-util-y += hwmon_pmu.o 93240505b2SIan Rogersperf-util-y += tool_pmu.o 94d002aab8SIan Rogersperf-util-y += tp_pmu.o 95e467705aSIan Rogersperf-util-y += svghelper.o 96800c93ffSIan Rogersperf-util-y += trace-event-info.o 97e467705aSIan Rogersperf-util-y += trace-event-scripting.o 98e467705aSIan Rogersperf-util-$(CONFIG_LIBTRACEEVENT) += trace-event.o 99e467705aSIan Rogersperf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-parse.o 100e467705aSIan Rogersperf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-read.o 101e467705aSIan Rogersperf-util-y += sort.o 102e467705aSIan Rogersperf-util-y += hist.o 103e467705aSIan Rogersperf-util-y += util.o 104e467705aSIan Rogersperf-util-y += cpumap.o 105e467705aSIan Rogersperf-util-y += affinity.o 106e467705aSIan Rogersperf-util-y += cputopo.o 107e467705aSIan Rogersperf-util-y += cgroup.o 108e467705aSIan Rogersperf-util-y += target.o 109e467705aSIan Rogersperf-util-y += rblist.o 110e467705aSIan Rogersperf-util-y += intlist.o 111e467705aSIan Rogersperf-util-y += vdso.o 112e467705aSIan Rogersperf-util-y += counts.o 113e467705aSIan Rogersperf-util-y += stat.o 114e467705aSIan Rogersperf-util-y += stat-shadow.o 115e467705aSIan Rogersperf-util-y += stat-display.o 116e467705aSIan Rogersperf-util-y += perf_api_probe.o 117e467705aSIan Rogersperf-util-y += record.o 118e467705aSIan Rogersperf-util-y += srcline.o 119e467705aSIan Rogersperf-util-y += srccode.o 120e467705aSIan Rogersperf-util-y += synthetic-events.o 121e467705aSIan Rogersperf-util-y += data.o 122e467705aSIan Rogersperf-util-y += tsc.o 123e467705aSIan Rogersperf-util-y += cloexec.o 124e467705aSIan Rogersperf-util-y += call-path.o 125e467705aSIan Rogersperf-util-y += rwsem.o 126e467705aSIan Rogersperf-util-y += thread-stack.o 127e467705aSIan Rogersperf-util-y += spark.o 128e467705aSIan Rogersperf-util-y += topdown.o 129e467705aSIan Rogersperf-util-y += iostat.o 130e467705aSIan Rogersperf-util-y += stream.o 131*ceea279fSIan Rogersperf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o 132*ceea279fSIan Rogersperf-util-y += kvm-stat-arch/ 1331a12ed09SIan Rogersperf-util-y += lock-contention.o 134754187adSIan Rogersperf-util-y += auxtrace.o 135e7bb49e3SIan Rogersperf-util-y += intel-pt-decoder/ 136754187adSIan Rogersperf-util-y += intel-pt.o 137754187adSIan Rogersperf-util-y += intel-bts.o 138754187adSIan Rogersperf-util-y += arm-spe.o 139754187adSIan Rogersperf-util-y += arm-spe-decoder/ 140754187adSIan Rogersperf-util-y += hisi-ptt.o 141754187adSIan Rogersperf-util-y += hisi-ptt-decoder/ 142754187adSIan Rogersperf-util-y += s390-cpumsf.o 143754187adSIan Rogersperf-util-y += powerpc-vpadtl.o 144440a23b3SMathieu Poirier 145440a23b3SMathieu Poirierifdef CONFIG_LIBOPENCSD 146754187adSIan Rogersperf-util-y += cs-etm.o 147754187adSIan Rogersperf-util-y += cs-etm-decoder/ 148440a23b3SMathieu Poirierendif 149754187adSIan Rogersperf-util-y += cs-etm-base.o 150440a23b3SMathieu Poirier 151e467705aSIan Rogersperf-util-y += parse-branch-options.o 152e467705aSIan Rogersperf-util-y += parse-regs-options.o 153e467705aSIan Rogersperf-util-y += parse-sublevel-options.o 154e467705aSIan Rogersperf-util-y += term.o 155e467705aSIan Rogersperf-util-y += help-unknown-cmd.o 156e467705aSIan Rogersperf-util-y += dlfilter.o 157e467705aSIan Rogersperf-util-y += mem-events.o 158e467705aSIan Rogersperf-util-y += mem-info.o 159e467705aSIan Rogersperf-util-y += vsprintf.o 160e467705aSIan Rogersperf-util-y += units.o 161e467705aSIan Rogersperf-util-y += time-utils.o 162e467705aSIan Rogersperf-util-y += expr-flex.o 163e467705aSIan Rogersperf-util-y += expr-bison.o 164e467705aSIan Rogersperf-util-y += expr.o 165e467705aSIan Rogersperf-util-y += branch.o 166e467705aSIan Rogersperf-util-y += mem2node.o 167e467705aSIan Rogersperf-util-y += clockid.o 168e467705aSIan Rogersperf-util-y += list_sort.o 169e467705aSIan Rogersperf-util-y += mutex.o 170e467705aSIan Rogersperf-util-y += sharded_mutex.o 171eb493c28SIan Rogersperf-util-y += intel-tpebs.o 1729352aabaSJiri Olsa 173e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o 174e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter_cgroup.o 175e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_ftrace.o 176e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o 177e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter.o 178e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-flex.o 179e467705aSIan Rogersperf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-bison.o 180dcf90042SArnaldo Carvalho de Meloperf-util-$(CONFIG_PERF_BPF_SKEL) += btf.o 18116cad1d3SNamhyung Kim 1821bec43f5SNamhyung Kimifeq ($(CONFIG_TRACE),y) 1831bec43f5SNamhyung Kim perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-trace-summary.o 184f6109fb6SNamhyung Kim perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_trace_augment.o 1851bec43f5SNamhyung Kimendif 1861bec43f5SNamhyung Kim 18716cad1d3SNamhyung Kimifeq ($(CONFIG_LIBTRACEEVENT),y) 188e467705aSIan Rogers perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o 18916cad1d3SNamhyung Kimendif 190378ef0f5SIan Rogers 191378ef0f5SIan Rogersifeq ($(CONFIG_LIBTRACEEVENT),y) 192e467705aSIan Rogers perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork.o 193e467705aSIan Rogers perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork_top.o 194378ef0f5SIan Rogersendif 195378ef0f5SIan Rogers 196e467705aSIan Rogersperf-util-$(CONFIG_LIBELF) += symbol-elf.o 197e467705aSIan Rogersperf-util-$(CONFIG_LIBELF) += probe-file.o 198e467705aSIan Rogersperf-util-$(CONFIG_LIBELF) += probe-event.o 199709e6791SJiri Olsa 200ad1237c3SJiri Olsaifdef CONFIG_LIBBPF_DYNAMIC 201ad1237c3SJiri Olsa hashmap := 1 202ad1237c3SJiri Olsaendif 203eee19501SIan Rogersifndef CONFIG_LIBBPF 204ad1237c3SJiri Olsa hashmap := 1 205ad1237c3SJiri Olsaendif 206ad1237c3SJiri Olsa 207ad1237c3SJiri Olsaifdef hashmap 208e467705aSIan Rogersperf-util-y += hashmap.o 209eee19501SIan Rogersendif 210eee19501SIan Rogers 211709e6791SJiri Olsaifndef CONFIG_LIBELF 212e467705aSIan Rogersperf-util-y += symbol-minimal.o 213709e6791SJiri Olsaendif 214709e6791SJiri Olsa 21586bcdb5aSArnaldo Carvalho de Meloifndef CONFIG_SETNS 216e467705aSIan Rogersperf-util-y += setns.o 21786bcdb5aSArnaldo Carvalho de Meloendif 21886bcdb5aSArnaldo Carvalho de Melo 2195455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += probe-finder.o 2205455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += dwarf-aux.o 2215455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += dwarf-regs.o 2221672f370SIan Rogersperf-util-$(CONFIG_LIBDW) += dwarf-regs-arch/ 2235455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += debuginfo.o 2245455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += annotate-data.o 22588c51002SIan Rogersperf-util-$(CONFIG_LIBDW) += libdw.o 2262e919157SIan Rogersperf-util-$(CONFIG_LIBDW) += unwind-libdw.o 2278379fce4SJiri Olsa 228e467705aSIan Rogersperf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o 229e467705aSIan Rogersperf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.o 230e467705aSIan Rogersperf-util-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o 231e467705aSIan Rogersperf-util-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o 232b2e45c32SJiri Olsa 233378ef0f5SIan Rogersifeq ($(CONFIG_LIBTRACEEVENT),y) 234e467705aSIan Rogers perf-util-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o 235378ef0f5SIan Rogersendif 236378ef0f5SIan Rogers 237e467705aSIan Rogersperf-util-y += data-convert-json.o 238edbe9817SJiri Olsa 239e467705aSIan Rogersperf-util-y += scripting-engines/ 240c7355f84SJiri Olsa 241e467705aSIan Rogersperf-util-$(CONFIG_ZLIB) += zlib.o 242e467705aSIan Rogersperf-util-$(CONFIG_LZMA) += lzma.o 243e467705aSIan Rogersperf-util-$(CONFIG_ZSTD) += zstd.o 244f24c1d75SAlexey Budankov 245e25ebda7SIan Rogersperf-util-y += cap.o 246c22e150eSIgor Lubashev 247e467705aSIan Rogersperf-util-$(CONFIG_CXX_DEMANGLE) += demangle-cxx.o 248e467705aSIan Rogersperf-util-y += demangle-ocaml.o 249e467705aSIan Rogersperf-util-y += demangle-java.o 250e20848c3SIan Rogersperf-util-y += demangle-rust-v0.o 251c3f8644cSSteinar H. Gundersonperf-util-$(CONFIG_LIBLLVM) += llvm-c-helpers.o 25246dad054SArnaldo Carvalho de Melo 253e20848c3SIan RogersCFLAGS_demangle-rust-v0.o += -Wno-shadow -Wno-declaration-after-statement \ 254e20848c3SIan Rogers -Wno-switch-default -Wno-switch-enum -Wno-missing-field-initializers 255e20848c3SIan Rogers 256e12b202fSJiri Olsaifdef CONFIG_JITDUMP 257e467705aSIan Rogersperf-util-$(CONFIG_LIBELF) += jitdump.o 258e467705aSIan Rogersperf-util-$(CONFIG_LIBELF) += genelf.o 2595455d89bSIan Rogersperf-util-$(CONFIG_LIBDW) += genelf_debug.o 26046dad054SArnaldo Carvalho de Meloendif 2613bc3374cSJiri Olsa 262e467705aSIan Rogersperf-util-y += perf-hooks.o 263a074865eSWang Nan 264e467705aSIan Rogersperf-util-$(CONFIG_LIBBPF) += bpf-event.o 265e467705aSIan Rogersperf-util-$(CONFIG_LIBBPF) += bpf-utils.o 26645178a92SSong Liu 267e467705aSIan Rogersperf-util-$(CONFIG_LIBPFM4) += pfm.o 26870943490SStephane Eranian 2699352aabaSJiri OlsaCFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 2701b16fffaSArnaldo Carvalho de Melo 271598b7c69SStephane Eranian# avoid compiler warnings in 32-bit mode 272598b7c69SStephane EranianCFLAGS_genelf_debug.o += -Wno-packed 2739352aabaSJiri Olsa 2744b971df9SIan Rogers$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c 2751999307bSJiri Olsa $(call rule_mkdir) 2764b971df9SIan Rogers $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \ 2774b971df9SIan Rogers --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) $< 2789352aabaSJiri Olsa 279ef9894d9SIan Rogers$(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y 2801999307bSJiri Olsa $(call rule_mkdir) 2819462e4deSIan Rogers $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) $(BISON_FALLBACK_FLAGS) \ 282ef9894d9SIan Rogers -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ 2839352aabaSJiri Olsa 2844b971df9SIan Rogers$(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c 28526226a97SJiri Olsa $(call rule_mkdir) 2864b971df9SIan Rogers $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/expr-flex.c \ 2874b971df9SIan Rogers --header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) $< 28826226a97SJiri Olsa 289ef9894d9SIan Rogers$(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y 29007516736SAndi Kleen $(call rule_mkdir) 2916793672aSDenys Zagorui $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 292ef9894d9SIan Rogers -o $(OUTPUT)util/expr-bison.c -p expr_ 29307516736SAndi Kleen 2944b971df9SIan Rogers$(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c 2951999307bSJiri Olsa $(call rule_mkdir) 2964b971df9SIan Rogers $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/pmu-flex.c \ 2974b971df9SIan Rogers --header-file=$(OUTPUT)util/pmu-flex.h $(PARSER_DEBUG_FLEX) $< 2989352aabaSJiri Olsa 299ef9894d9SIan Rogers$(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y 3001999307bSJiri Olsa $(call rule_mkdir) 3016793672aSDenys Zagorui $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 302ef9894d9SIan Rogers -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ 3039352aabaSJiri Olsa 304591156f2SNamhyung Kim$(OUTPUT)util/bpf-filter-flex.c $(OUTPUT)util/bpf-filter-flex.h: util/bpf-filter.l $(OUTPUT)util/bpf-filter-bison.c util/bpf-filter.h util/bpf_skel/sample-filter.h 305990a71e9SNamhyung Kim $(call rule_mkdir) 306990a71e9SNamhyung Kim $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/bpf-filter-flex.c \ 307990a71e9SNamhyung Kim --header-file=$(OUTPUT)util/bpf-filter-flex.h $(PARSER_DEBUG_FLEX) $< 308990a71e9SNamhyung Kim 309591156f2SNamhyung Kim$(OUTPUT)util/bpf-filter-bison.c $(OUTPUT)util/bpf-filter-bison.h: util/bpf-filter.y util/bpf-filter.h util/bpf_skel/sample-filter.h 310990a71e9SNamhyung Kim $(call rule_mkdir) 311990a71e9SNamhyung Kim $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ 312990a71e9SNamhyung Kim -o $(OUTPUT)util/bpf-filter-bison.c -p perf_bpf_filter_ 313990a71e9SNamhyung Kim 31410c775afSIan RogersFLEX_VERSION := $(shell $(FLEX) --version | cut -d' ' -f2) 31510c775afSIan Rogers 31610c775afSIan RogersFLEX_GE_260 := $(call version-ge3,$(FLEX_VERSION),2.6.0) 31710c775afSIan Rogersifeq ($(FLEX_GE_260),1) 31810c775afSIan Rogers flex_flags := -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-misleading-indentation 31910c775afSIan Rogers 32010c775afSIan Rogers # Some newer clang and gcc version complain about this 32110c775afSIan Rogers # util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] 32210c775afSIan Rogers # int yynerrs = 0; 32310c775afSIan Rogers 32410c775afSIan Rogers flex_flags += -Wno-unused-but-set-variable 32510c775afSIan Rogers 32610c775afSIan Rogers FLEX_LT_262 := $(call version-lt3,$(FLEX_VERSION),2.6.2) 32710c775afSIan Rogers ifeq ($(FLEX_LT_262),1) 32810c775afSIan Rogers flex_flags += -Wno-sign-compare 329304d7a90SIan Rogers endif 330304d7a90SIan Rogerselse 331304d7a90SIan Rogers flex_flags := -w 332304d7a90SIan Rogersendif 33310c775afSIan Rogers 334ddc8e4c9SIan Rogers# Some newer clang and gcc version complain about this 335ddc8e4c9SIan Rogers# util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] 336ddc8e4c9SIan Rogers# int yynerrs = 0; 337ddc8e4c9SIan Rogers 338ddc8e4c9SIan Rogersbison_flags := -DYYENABLE_NLS=0 -Wno-unused-but-set-variable 339878460e8SArnaldo Carvalho de Melo 340878460e8SArnaldo Carvalho de Melo# Old clangs don't grok -Wno-unused-but-set-variable, remove it 341878460e8SArnaldo Carvalho de Meloifeq ($(CC_NO_CLANG), 0) 342878460e8SArnaldo Carvalho de Melo CLANG_VERSION := $(shell $(CLANG) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') 343878460e8SArnaldo Carvalho de Melo ifeq ($(call version-lt3,$(CLANG_VERSION),13.0.0),1) 344878460e8SArnaldo Carvalho de Melo bison_flags := $(subst -Wno-unused-but-set-variable,,$(bison_flags)) 345878460e8SArnaldo Carvalho de Melo flex_flags := $(subst -Wno-unused-but-set-variable,,$(flex_flags)) 346878460e8SArnaldo Carvalho de Melo endif 347878460e8SArnaldo Carvalho de Meloendif 348878460e8SArnaldo Carvalho de Melo 349ddc8e4c9SIan RogersBISON_GE_382 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 382) 350ddc8e4c9SIan Rogersifeq ($(BISON_GE_382),1) 351ddc8e4c9SIan Rogers bison_flags += -Wno-switch-enum 3521f16fcadSIan Rogerselse 3531f16fcadSIan Rogers bison_flags += -w 3541f16fcadSIan Rogersendif 35588cc47e2SArnaldo Carvalho de Melo 35688cc47e2SArnaldo Carvalho de MeloBISON_LT_381 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 381) 35788cc47e2SArnaldo Carvalho de Meloifeq ($(BISON_LT_381),1) 35888cc47e2SArnaldo Carvalho de Melo bison_flags += -DYYNOMEM=YYABORT 35988cc47e2SArnaldo Carvalho de Meloendif 36088cc47e2SArnaldo Carvalho de Melo 3613d6dfae8SIan RogersCFLAGS_parse-events-flex.o += $(flex_flags) -Wno-unused-label 362878460e8SArnaldo Carvalho de MeloCFLAGS_pmu-flex.o += $(flex_flags) 363878460e8SArnaldo Carvalho de MeloCFLAGS_expr-flex.o += $(flex_flags) 364878460e8SArnaldo Carvalho de MeloCFLAGS_bpf-filter-flex.o += $(flex_flags) 365878460e8SArnaldo Carvalho de Melo 3661f16fcadSIan RogersCFLAGS_parse-events-bison.o += $(bison_flags) 3671f16fcadSIan RogersCFLAGS_pmu-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags) 3681f16fcadSIan RogersCFLAGS_expr-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags) 369990a71e9SNamhyung KimCFLAGS_bpf-filter-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags) 3709352aabaSJiri Olsa 3719352aabaSJiri Olsa$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c 3729352aabaSJiri Olsa$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c 37326226a97SJiri Olsa$(OUTPUT)util/expr.o: $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-bison.c 374990a71e9SNamhyung Kim$(OUTPUT)util/bpf-filter.o: $(OUTPUT)util/bpf-filter-flex.c $(OUTPUT)util/bpf-filter-bison.c 3759352aabaSJiri Olsa 376915b0882SArnaldo Carvalho de MeloCFLAGS_bitmap.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 377552eb975SArnaldo Carvalho de MeloCFLAGS_find_bit.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 3789352aabaSJiri OlsaCFLAGS_rbtree.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 3794ddd3274SArnaldo Carvalho de MeloCFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 3809352aabaSJiri OlsaCFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" 381d25ed5d9SSoramichi AKIYAMACFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILE 382a29ee6aeSOliver UptonCFLAGS_arm-spe.o += -I$(srctree)/tools/arch/arm64/include/ -I$(OUTPUT)arch/arm64/include/generated/ 3839352aabaSJiri Olsa 3849c10548cSArnaldo Carvalho de Melo$(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE 3859c10548cSArnaldo Carvalho de Melo $(call rule_mkdir) 3869c10548cSArnaldo Carvalho de Melo $(call if_changed_dep,cc_o_c) 3879c10548cSArnaldo Carvalho de Melo 388915b0882SArnaldo Carvalho de Melo$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE 389915b0882SArnaldo Carvalho de Melo $(call rule_mkdir) 390915b0882SArnaldo Carvalho de Melo $(call if_changed_dep,cc_o_c) 391915b0882SArnaldo Carvalho de Melo 3923052ba56SArnaldo Carvalho de Melo$(OUTPUT)util/ctype.o: ../lib/ctype.c FORCE 3933052ba56SArnaldo Carvalho de Melo $(call rule_mkdir) 3943052ba56SArnaldo Carvalho de Melo $(call if_changed_dep,cc_o_c) 3953052ba56SArnaldo Carvalho de Melo 396552eb975SArnaldo Carvalho de Melo$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE 3971999307bSJiri Olsa $(call rule_mkdir) 3989352aabaSJiri Olsa $(call if_changed_dep,cc_o_c) 3999352aabaSJiri Olsa 4003f735377SArnaldo Carvalho de Melo$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE 4011999307bSJiri Olsa $(call rule_mkdir) 4029352aabaSJiri Olsa $(call if_changed_dep,cc_o_c) 4039352aabaSJiri Olsa 4044ddd3274SArnaldo Carvalho de Melo$(OUTPUT)util/libstring.o: ../lib/string.c FORCE 4054ddd3274SArnaldo Carvalho de Melo $(call rule_mkdir) 4064ddd3274SArnaldo Carvalho de Melo $(call if_changed_dep,cc_o_c) 4074ddd3274SArnaldo Carvalho de Melo 4080aefc359SArnaldo Carvalho de Melo$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE 4091999307bSJiri Olsa $(call rule_mkdir) 4109352aabaSJiri Olsa $(call if_changed_dep,cc_o_c) 411d0761e37SArnaldo Carvalho de Melo 412d0761e37SArnaldo Carvalho de Melo$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE 413d0761e37SArnaldo Carvalho de Melo $(call rule_mkdir) 414d0761e37SArnaldo Carvalho de Melo $(call if_changed_dep,cc_o_c) 41592ec3cc9SIan Rogers 41692ec3cc9SIan Rogers$(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE 41792ec3cc9SIan Rogers $(call rule_mkdir) 41892ec3cc9SIan Rogers $(call if_changed_dep,cc_o_c) 41961ff60aaSIan Rogers 420168910d0SIan RogersPY_TESTS := setup.py 421168910d0SIan Rogersifdef MYPY 422168910d0SIan Rogers MYPY_TEST_LOGS := $(PY_TESTS:%=%.mypy_log) 423168910d0SIan Rogerselse 424168910d0SIan Rogers MYPY_TEST_LOGS := 425168910d0SIan Rogersendif 426168910d0SIan Rogers 427168910d0SIan Rogers$(OUTPUT)%.mypy_log: % 428168910d0SIan Rogers $(call rule_mkdir) 429168910d0SIan Rogers $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) 430168910d0SIan Rogers 431168910d0SIan Rogersperf-util-y += $(MYPY_TEST_LOGS) 4328a54784eSIan Rogers 4338a54784eSIan Rogersifdef PYLINT 4348a54784eSIan Rogers PYLINT_TEST_LOGS := $(PY_TESTS:%=%.pylint_log) 4358a54784eSIan Rogerselse 4368a54784eSIan Rogers PYLINT_TEST_LOGS := 4378a54784eSIan Rogersendif 4388a54784eSIan Rogers 4398a54784eSIan Rogers$(OUTPUT)%.pylint_log: % 4408a54784eSIan Rogers $(call rule_mkdir) 4418a54784eSIan Rogers $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) 4428a54784eSIan Rogers 4438a54784eSIan Rogersperf-util-y += $(PYLINT_TEST_LOGS) 444