1 # SPDX-License-Identifier: GPL-2.0
2 # Some of the tools (perf) use same make variables
7 include scripts/Makefile.include
10 @echo 'Possible targets:'
12 @echo ' acpi - ACPI tools'
13 @echo ' cgroup - cgroup tools'
14 @echo ' cpupower - a tool for all things x86 CPU power'
15 @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
16 @echo ' firmware - Firmware tools'
17 @echo ' freefall - laptop accelerometer program for disk protection'
18 @echo ' gpio - GPIO tools'
19 @echo ' hv - tools used when in Hyper-V clients'
20 @echo ' iio - IIO tools'
21 @echo ' kvm_stat - top-like utility for displaying kvm statistics'
22 @echo ' leds - LEDs tools'
23 @echo ' liblockdep - user-space wrapper for kernel locking-validator'
24 @echo ' bpf - misc BPF tools'
25 @echo ' pci - PCI tools'
26 @echo ' perf - Linux performance measurement and analysis tool'
27 @echo ' selftests - various kernel selftests'
28 @echo ' spi - spi tools'
29 @echo ' objtool - an ELF object analysis tool'
30 @echo ' tmon - thermal monitoring and tuning tool'
31 @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
32 @echo ' usb - USB testing tools'
33 @echo ' virtio - vhost test module'
34 @echo ' vm - misc vm tools'
35 @echo ' wmi - WMI interface examples'
36 @echo ' x86_energy_perf_policy - Intel energy policy tool'
39 @echo ' $$ make -C tools/ <tool>_install'
41 @echo ' from the kernel command line to build and install one of'
42 @echo ' the tools above'
44 @echo ' $$ make tools/all'
46 @echo ' builds all tools.'
48 @echo ' $$ make tools/install'
50 @echo ' installs all tools.'
52 @echo 'Cleaning targets:'
54 @echo ' all of the above with the "_clean" string appended cleans'
55 @echo ' the respective build directory.'
56 @echo ' clean: a summary clean target to clean _all_ folders'
59 $(call descend,power/$@)
62 $(call descend,power/$@)
64 cgroup firewire hv guest spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware: FORCE
68 $(call descend,lib/lockdep)
71 $(call descend,lib/api)
73 # The perf build does not follow the descend function setup,
74 # invoking it via it's own make rule.
75 PERF_O = $(if $(O),$(O)/tools/perf,)
78 $(Q)mkdir -p $(PERF_O) .
79 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
82 $(call descend,testing/$@)
84 turbostat x86_energy_perf_policy: FORCE
85 $(call descend,power/x86/$@)
88 $(call descend,thermal/$@)
91 $(call descend,laptop/$@)
94 $(call descend,kvm/$@)
96 all: acpi cgroup cpupower gpio hv firewire liblockdep \
97 perf selftests spi turbostat usb \
98 virtio vm bpf x86_energy_perf_policy \
99 tmon freefall iio objtool kvm_stat wmi pci
102 $(call descend,power/$(@:_install=),install)
105 $(call descend,power/$(@:_install=),install)
107 cgroup_install firewire_install gpio_install hv_install iio_install perf_install spi_install usb_install virtio_install vm_install bpf_install objtool_install wmi_install pci_install:
108 $(call descend,$(@:_install=),install)
111 $(call descend,lib/lockdep,install)
114 $(call descend,testing/$(@:_install=),install)
116 turbostat_install x86_energy_perf_policy_install:
117 $(call descend,power/x86/$(@:_install=),install)
120 $(call descend,thermal/$(@:_install=),install)
123 $(call descend,laptop/$(@:_install=),install)
126 $(call descend,kvm/$(@:_install=),install)
128 install: acpi_install cgroup_install cpupower_install gpio_install \
129 hv_install firewire_install iio_install liblockdep_install \
130 perf_install selftests_install turbostat_install usb_install \
131 virtio_install vm_install bpf_install x86_energy_perf_policy_install \
132 tmon_install freefall_install objtool_install kvm_stat_install \
133 wmi_install pci_install
136 $(call descend,power/acpi,clean)
139 $(call descend,power/cpupower,clean)
141 cgroup_clean hv_clean firewire_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:
142 $(call descend,$(@:_clean=),clean)
145 $(call descend,lib/lockdep,clean)
148 $(call descend,lib/api,clean)
151 $(call descend,lib/bpf,clean)
154 $(call descend,lib/subcmd,clean)
157 $(Q)mkdir -p $(PERF_O) .
158 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
161 $(call descend,testing/$(@:_clean=),clean)
163 turbostat_clean x86_energy_perf_policy_clean:
164 $(call descend,power/x86/$(@:_clean=),clean)
167 $(call descend,thermal/tmon,clean)
170 $(call descend,laptop/freefall,clean)
173 $(call descend,build,clean)
175 clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean \
176 perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
177 vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
178 freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
179 gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean