Commit | Line | Data |
---|---|---|
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. | |
4 | export srctree= | |
5 | export objtree= | |
6 | ||
2363ecb1 BP |
7 | include scripts/Makefile.include |
8 | ||
d5dd8afb BP |
9 | help: |
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' |
38fe26b4 | 27 | @echo ' objtool - an ELF object analysis tool' |
1ce78ce0 | 28 | @echo ' pci - PCI tools' |
20a7add8 JP |
29 | @echo ' perf - Linux performance measurement and analysis tool' |
30 | @echo ' selftests - various kernel selftests' | |
950313eb | 31 | @echo ' bootconfig - boot config tool' |
747a9b0a | 32 | @echo ' spi - spi tools' |
20a7add8 | 33 | @echo ' tmon - thermal monitoring and tuning tool' |
110acbc6 | 34 | @echo ' thermometer - temperature capture tool' |
47c4b0de | 35 | @echo ' thermal - thermal library' |
e23db805 | 36 | @echo ' tracing - misc tracing tools' |
20a7add8 JP |
37 | @echo ' turbostat - Intel CPU idle stats and freq reporting tool' |
38 | @echo ' usb - USB testing tools' | |
39 | @echo ' virtio - vhost test module' | |
40 | @echo ' vm - misc vm tools' | |
9d64fc08 | 41 | @echo ' wmi - WMI interface examples' |
d5dd8afb BP |
42 | @echo ' x86_energy_perf_policy - Intel energy policy tool' |
43 | @echo '' | |
ea01fa9f | 44 | @echo 'You can do:' |
7e010562 | 45 | @echo ' $$ make -C tools/ <tool>_install' |
ea01fa9f BP |
46 | @echo '' |
47 | @echo ' from the kernel command line to build and install one of' | |
48 | @echo ' the tools above' | |
49 | @echo '' | |
f6ba98c5 KM |
50 | @echo ' $$ make tools/all' |
51 | @echo '' | |
52 | @echo ' builds all tools.' | |
53 | @echo '' | |
ea01fa9f BP |
54 | @echo ' $$ make tools/install' |
55 | @echo '' | |
56 | @echo ' installs all tools.' | |
57 | @echo '' | |
d5dd8afb BP |
58 | @echo 'Cleaning targets:' |
59 | @echo '' | |
60 | @echo ' all of the above with the "_clean" string appended cleans' | |
61 | @echo ' the respective build directory.' | |
62 | @echo ' clean: a summary clean target to clean _all_ folders' | |
63 | ||
a0c4acc0 LZ |
64 | acpi: FORCE |
65 | $(call descend,power/$@) | |
66 | ||
2363ecb1 | 67 | cpupower: FORCE |
ca9dfc6c | 68 | $(call descend,power/$@) |
2363ecb1 | 69 | |
08609989 | 70 | cgroup counter firewire hv guest bootconfig spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE |
85c66be1 BP |
71 | $(call descend,$@) |
72 | ||
33a57ce0 JO |
73 | bpf/%: FORCE |
74 | $(call descend,$@) | |
75 | ||
379a9a28 | 76 | libapi: FORCE |
553873e1 | 77 | $(call descend,lib/api) |
85c66be1 | 78 | |
16671c1e JO |
79 | # The perf build does not follow the descend function setup, |
80 | # invoking it via it's own make rule. | |
81 | PERF_O = $(if $(O),$(O)/tools/perf,) | |
82 | ||
379a9a28 | 83 | perf: FORCE |
16671c1e JO |
84 | $(Q)mkdir -p $(PERF_O) . |
85 | $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= | |
2363ecb1 BP |
86 | |
87 | selftests: FORCE | |
ca9dfc6c | 88 | $(call descend,testing/$@) |
2363ecb1 | 89 | |
47c4b0de DL |
90 | thermal: FORCE |
91 | $(call descend,lib/$@) | |
92 | ||
3fb4f7cd | 93 | turbostat x86_energy_perf_policy intel-speed-select: FORCE |
ca9dfc6c | 94 | $(call descend,power/x86/$@) |
2363ecb1 | 95 | |
94f69966 JP |
96 | tmon: FORCE |
97 | $(call descend,thermal/$@) | |
98 | ||
110acbc6 DL |
99 | thermometer: FORCE |
100 | $(call descend,thermal/$@) | |
101 | ||
b3fd7368 PR |
102 | freefall: FORCE |
103 | $(call descend,laptop/$@) | |
104 | ||
ee5f7d79 JF |
105 | kvm_stat: FORCE |
106 | $(call descend,kvm/$@) | |
107 | ||
7246f4dc | 108 | all: acpi cgroup counter cpupower gpio hv firewire \ |
950313eb | 109 | perf selftests bootconfig spi turbostat usb \ |
a92bb546 | 110 | virtio vm bpf x86_energy_perf_policy \ |
4ab5a5d2 | 111 | tmon freefall iio objtool kvm_stat wmi \ |
110acbc6 | 112 | pci debugging tracing thermal thermometer |
f6ba98c5 | 113 | |
a0c4acc0 LZ |
114 | acpi_install: |
115 | $(call descend,power/$(@:_install=),install) | |
116 | ||
2363ecb1 | 117 | cpupower_install: |
ca9dfc6c | 118 | $(call descend,power/$(@:_install=),install) |
2363ecb1 | 119 | |
08609989 | 120 | cgroup_install counter_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install vm_install bpf_install objtool_install wmi_install pci_install debugging_install tracing_install: |
ca9dfc6c | 121 | $(call descend,$(@:_install=),install) |
2363ecb1 BP |
122 | |
123 | selftests_install: | |
9a13c658 | 124 | $(call descend,testing/$(@:_install=),install) |
2363ecb1 | 125 | |
47c4b0de DL |
126 | thermal_install: |
127 | $(call descend,lib/$(@:_install=),install) | |
128 | ||
3fb4f7cd | 129 | turbostat_install x86_energy_perf_policy_install intel-speed-select_install: |
ca9dfc6c | 130 | $(call descend,power/x86/$(@:_install=),install) |
2363ecb1 | 131 | |
94f69966 JP |
132 | tmon_install: |
133 | $(call descend,thermal/$(@:_install=),install) | |
134 | ||
110acbc6 DL |
135 | thermometer_install: |
136 | $(call descend,thermal/$(@:_install=),install) | |
137 | ||
b3fd7368 PR |
138 | freefall_install: |
139 | $(call descend,laptop/$(@:_install=),install) | |
140 | ||
f9bc9e65 JF |
141 | kvm_stat_install: |
142 | $(call descend,kvm/$(@:_install=),install) | |
143 | ||
08609989 | 144 | install: acpi_install cgroup_install counter_install cpupower_install gpio_install \ |
7246f4dc | 145 | hv_install firewire_install iio_install \ |
92e015b1 | 146 | perf_install selftests_install turbostat_install usb_install \ |
a92bb546 | 147 | virtio_install vm_install bpf_install x86_energy_perf_policy_install \ |
9d64fc08 | 148 | tmon_install freefall_install objtool_install kvm_stat_install \ |
e23db805 | 149 | wmi_install pci_install debugging_install intel-speed-select_install \ |
110acbc6 | 150 | tracing_install thermometer_install |
2363ecb1 | 151 | |
a0c4acc0 LZ |
152 | acpi_clean: |
153 | $(call descend,power/acpi,clean) | |
154 | ||
2363ecb1 | 155 | cpupower_clean: |
ca9dfc6c | 156 | $(call descend,power/cpupower,clean) |
2363ecb1 | 157 | |
08609989 | 158 | cgroup_clean counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean vm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean tracing_clean: |
85c66be1 BP |
159 | $(call descend,$(@:_clean=),clean) |
160 | ||
379a9a28 | 161 | libapi_clean: |
553873e1 | 162 | $(call descend,lib/api,clean) |
85c66be1 | 163 | |
2f5a7f1d JO |
164 | libbpf_clean: |
165 | $(call descend,lib/bpf,clean) | |
166 | ||
167 | libsubcmd_clean: | |
168 | $(call descend,lib/subcmd,clean) | |
169 | ||
379a9a28 | 170 | perf_clean: |
ab362f5a JO |
171 | $(Q)mkdir -p $(PERF_O) . |
172 | $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean | |
2363ecb1 BP |
173 | |
174 | selftests_clean: | |
ca9dfc6c | 175 | $(call descend,testing/$(@:_clean=),clean) |
2363ecb1 | 176 | |
47c4b0de DL |
177 | thermal_clean: |
178 | $(call descend,lib/thermal,clean) | |
179 | ||
3fb4f7cd | 180 | turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean: |
ca9dfc6c | 181 | $(call descend,power/x86/$(@:_clean=),clean) |
2363ecb1 | 182 | |
110acbc6 DL |
183 | thermometer_clean: |
184 | $(call descend,thermal/thermometer,clean) | |
185 | ||
94f69966 JP |
186 | tmon_clean: |
187 | $(call descend,thermal/tmon,clean) | |
188 | ||
b3fd7368 PR |
189 | freefall_clean: |
190 | $(call descend,laptop/freefall,clean) | |
191 | ||
2f5a7f1d JO |
192 | build_clean: |
193 | $(call descend,build,clean) | |
194 | ||
08609989 | 195 | clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \ |
950313eb | 196 | perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \ |
a92bb546 | 197 | vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \ |
7246f4dc | 198 | freefall_clean build_clean libbpf_clean libsubcmd_clean \ |
3fb4f7cd | 199 | gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \ |
110acbc6 | 200 | intel-speed-select_clean tracing_clean thermal_clean thermometer_clean |
2363ecb1 BP |
201 | |
202 | .PHONY: FORCE |