Merge tag 'riscv-for-linus-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / tools / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
16671c1e
JO
2# Some of the tools (perf) use same make variables
3# as in kernel build.
4export srctree=
5export objtree=
6
2363ecb1
BP
7include scripts/Makefile.include
8
d5dd8afb
BP
9help:
10 @echo 'Possible targets:'
11 @echo ''
20a7add8 12 @echo ' acpi - ACPI tools'
38fe26b4 13 @echo ' bpf - misc BPF tools'
20a7add8 14 @echo ' cgroup - cgroup tools'
08609989 15 @echo ' counter - counter tools'
20a7add8 16 @echo ' cpupower - a tool for all things x86 CPU power'
4ab5a5d2 17 @echo ' debugging - tools for debugging'
20a7add8 18 @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
1e510603 19 @echo ' firmware - Firmware tools'
20a7add8 20 @echo ' freefall - laptop accelerometer program for disk protection'
6d591c46 21 @echo ' gpio - GPIO tools'
20a7add8
JP
22 @echo ' hv - tools used when in Hyper-V clients'
23 @echo ' iio - IIO tools'
3fb4f7cd 24 @echo ' intel-speed-select - Intel Speed Select tool'
f9bc9e65 25 @echo ' kvm_stat - top-like utility for displaying kvm statistics'
fa7f3242 26 @echo ' leds - LEDs tools'
0b37dff1 27 @echo ' nolibc - nolibc headers testing and installation'
38fe26b4 28 @echo ' objtool - an ELF object analysis tool'
1ce78ce0 29 @echo ' pci - PCI tools'
20a7add8
JP
30 @echo ' perf - Linux performance measurement and analysis tool'
31 @echo ' selftests - various kernel selftests'
950313eb 32 @echo ' bootconfig - boot config tool'
747a9b0a 33 @echo ' spi - spi tools'
20a7add8 34 @echo ' tmon - thermal monitoring and tuning tool'
110acbc6 35 @echo ' thermometer - temperature capture tool'
077df623 36 @echo ' thermal-engine - thermal monitoring tool'
47c4b0de 37 @echo ' thermal - thermal library'
e23db805 38 @echo ' tracing - misc tracing tools'
20a7add8
JP
39 @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
40 @echo ' usb - USB testing tools'
41 @echo ' virtio - vhost test module'
a1014824 42 @echo ' mm - misc mm tools'
9d64fc08 43 @echo ' wmi - WMI interface examples'
d5dd8afb
BP
44 @echo ' x86_energy_perf_policy - Intel energy policy tool'
45 @echo ''
ea01fa9f 46 @echo 'You can do:'
7e010562 47 @echo ' $$ make -C tools/ <tool>_install'
ea01fa9f
BP
48 @echo ''
49 @echo ' from the kernel command line to build and install one of'
50 @echo ' the tools above'
51 @echo ''
f6ba98c5
KM
52 @echo ' $$ make tools/all'
53 @echo ''
54 @echo ' builds all tools.'
55 @echo ''
ea01fa9f
BP
56 @echo ' $$ make tools/install'
57 @echo ''
58 @echo ' installs all tools.'
59 @echo ''
d5dd8afb
BP
60 @echo 'Cleaning targets:'
61 @echo ''
62 @echo ' all of the above with the "_clean" string appended cleans'
63 @echo ' the respective build directory.'
64 @echo ' clean: a summary clean target to clean _all_ folders'
65
a0c4acc0
LZ
66acpi: FORCE
67 $(call descend,power/$@)
68
2363ecb1 69cpupower: FORCE
ca9dfc6c 70 $(call descend,power/$@)
2363ecb1 71
a1014824 72cgroup counter firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE
85c66be1
BP
73 $(call descend,$@)
74
33a57ce0
JO
75bpf/%: FORCE
76 $(call descend,$@)
77
379a9a28 78libapi: FORCE
553873e1 79 $(call descend,lib/api)
85c66be1 80
fe20cad4
WT
81nolibc: FORCE
82 $(call descend,include/nolibc)
83
0b37dff1
WT
84nolibc_%: FORCE
85 $(call descend,include/nolibc,$(patsubst nolibc_%,%,$@))
86
16671c1e
JO
87# The perf build does not follow the descend function setup,
88# invoking it via it's own make rule.
89PERF_O = $(if $(O),$(O)/tools/perf,)
90
379a9a28 91perf: FORCE
16671c1e
JO
92 $(Q)mkdir -p $(PERF_O) .
93 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
2363ecb1
BP
94
95selftests: FORCE
ca9dfc6c 96 $(call descend,testing/$@)
2363ecb1 97
47c4b0de
DL
98thermal: FORCE
99 $(call descend,lib/$@)
100
3fb4f7cd 101turbostat x86_energy_perf_policy intel-speed-select: FORCE
ca9dfc6c 102 $(call descend,power/x86/$@)
2363ecb1 103
94f69966
JP
104tmon: FORCE
105 $(call descend,thermal/$@)
106
110acbc6
DL
107thermometer: FORCE
108 $(call descend,thermal/$@)
109
077df623
DL
110thermal-engine: FORCE thermal
111 $(call descend,thermal/$@)
112
b3fd7368
PR
113freefall: FORCE
114 $(call descend,laptop/$@)
115
ee5f7d79
JF
116kvm_stat: FORCE
117 $(call descend,kvm/$@)
118
7246f4dc 119all: acpi cgroup counter cpupower gpio hv firewire \
950313eb 120 perf selftests bootconfig spi turbostat usb \
a1014824 121 virtio mm bpf x86_energy_perf_policy \
4ab5a5d2 122 tmon freefall iio objtool kvm_stat wmi \
077df623 123 pci debugging tracing thermal thermometer thermal-engine
f6ba98c5 124
a0c4acc0
LZ
125acpi_install:
126 $(call descend,power/$(@:_install=),install)
127
2363ecb1 128cpupower_install:
ca9dfc6c 129 $(call descend,power/$(@:_install=),install)
2363ecb1 130
a1014824 131cgroup_install counter_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install mm_install bpf_install objtool_install wmi_install pci_install debugging_install tracing_install:
ca9dfc6c 132 $(call descend,$(@:_install=),install)
2363ecb1
BP
133
134selftests_install:
9a13c658 135 $(call descend,testing/$(@:_install=),install)
2363ecb1 136
47c4b0de
DL
137thermal_install:
138 $(call descend,lib/$(@:_install=),install)
139
3fb4f7cd 140turbostat_install x86_energy_perf_policy_install intel-speed-select_install:
ca9dfc6c 141 $(call descend,power/x86/$(@:_install=),install)
2363ecb1 142
94f69966
JP
143tmon_install:
144 $(call descend,thermal/$(@:_install=),install)
145
110acbc6
DL
146thermometer_install:
147 $(call descend,thermal/$(@:_install=),install)
148
077df623
DL
149thermal-engine_install:
150 $(call descend,thermal/$(@:_install=),install)
151
b3fd7368
PR
152freefall_install:
153 $(call descend,laptop/$(@:_install=),install)
154
f9bc9e65
JF
155kvm_stat_install:
156 $(call descend,kvm/$(@:_install=),install)
157
08609989 158install: acpi_install cgroup_install counter_install cpupower_install gpio_install \
7246f4dc 159 hv_install firewire_install iio_install \
92e015b1 160 perf_install selftests_install turbostat_install usb_install \
a1014824 161 virtio_install mm_install bpf_install x86_energy_perf_policy_install \
9d64fc08 162 tmon_install freefall_install objtool_install kvm_stat_install \
e23db805 163 wmi_install pci_install debugging_install intel-speed-select_install \
077df623 164 tracing_install thermometer_install thermal-engine_install
2363ecb1 165
a0c4acc0
LZ
166acpi_clean:
167 $(call descend,power/acpi,clean)
168
2363ecb1 169cpupower_clean:
ca9dfc6c 170 $(call descend,power/cpupower,clean)
2363ecb1 171
a1014824 172cgroup_clean counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean tracing_clean:
85c66be1
BP
173 $(call descend,$(@:_clean=),clean)
174
379a9a28 175libapi_clean:
553873e1 176 $(call descend,lib/api,clean)
85c66be1 177
2f5a7f1d
JO
178libbpf_clean:
179 $(call descend,lib/bpf,clean)
180
181libsubcmd_clean:
182 $(call descend,lib/subcmd,clean)
183
379a9a28 184perf_clean:
ab362f5a
JO
185 $(Q)mkdir -p $(PERF_O) .
186 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
2363ecb1
BP
187
188selftests_clean:
ca9dfc6c 189 $(call descend,testing/$(@:_clean=),clean)
2363ecb1 190
47c4b0de
DL
191thermal_clean:
192 $(call descend,lib/thermal,clean)
193
3fb4f7cd 194turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean:
ca9dfc6c 195 $(call descend,power/x86/$(@:_clean=),clean)
2363ecb1 196
110acbc6
DL
197thermometer_clean:
198 $(call descend,thermal/thermometer,clean)
199
077df623
DL
200thermal-engine_clean:
201 $(call descend,thermal/thermal-engine,clean)
202
94f69966
JP
203tmon_clean:
204 $(call descend,thermal/tmon,clean)
205
b3fd7368
PR
206freefall_clean:
207 $(call descend,laptop/freefall,clean)
208
2f5a7f1d
JO
209build_clean:
210 $(call descend,build,clean)
211
08609989 212clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \
950313eb 213 perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
a1014824 214 mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
7246f4dc 215 freefall_clean build_clean libbpf_clean libsubcmd_clean \
3fb4f7cd 216 gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \
077df623 217 intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean
2363ecb1
BP
218
219.PHONY: FORCE