docs: Revamp tainted-kernels.rst to make it more comprehensible
[linux-2.6-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
JP
12 @echo ' acpi - ACPI tools'
13 @echo ' cgroup - cgroup tools'
14 @echo ' cpupower - a tool for all things x86 CPU power'
4ab5a5d2 15 @echo ' debugging - tools for debugging'
20a7add8
JP
16 @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
17 @echo ' freefall - laptop accelerometer program for disk protection'
6d591c46 18 @echo ' gpio - GPIO tools'
20a7add8
JP
19 @echo ' hv - tools used when in Hyper-V clients'
20 @echo ' iio - IIO tools'
f9bc9e65 21 @echo ' kvm_stat - top-like utility for displaying kvm statistics'
fa7f3242 22 @echo ' leds - LEDs tools'
24b4d0a1 23 @echo ' liblockdep - user-space wrapper for kernel locking-validator'
a92bb546 24 @echo ' bpf - misc BPF tools'
1ce78ce0 25 @echo ' pci - PCI tools'
20a7add8
JP
26 @echo ' perf - Linux performance measurement and analysis tool'
27 @echo ' selftests - various kernel selftests'
747a9b0a 28 @echo ' spi - spi tools'
442f04c3 29 @echo ' objtool - an ELF object analysis tool'
20a7add8
JP
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'
9d64fc08 35 @echo ' wmi - WMI interface examples'
d5dd8afb
BP
36 @echo ' x86_energy_perf_policy - Intel energy policy tool'
37 @echo ''
ea01fa9f 38 @echo 'You can do:'
7e010562 39 @echo ' $$ make -C tools/ <tool>_install'
ea01fa9f
BP
40 @echo ''
41 @echo ' from the kernel command line to build and install one of'
42 @echo ' the tools above'
43 @echo ''
f6ba98c5
KM
44 @echo ' $$ make tools/all'
45 @echo ''
46 @echo ' builds all tools.'
47 @echo ''
ea01fa9f
BP
48 @echo ' $$ make tools/install'
49 @echo ''
50 @echo ' installs all tools.'
51 @echo ''
d5dd8afb
BP
52 @echo 'Cleaning targets:'
53 @echo ''
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'
57
a0c4acc0
LZ
58acpi: FORCE
59 $(call descend,power/$@)
60
2363ecb1 61cpupower: FORCE
ca9dfc6c 62 $(call descend,power/$@)
2363ecb1 63
4ab5a5d2 64cgroup firewire hv guest spi usb virtio vm bpf iio gpio objtool leds wmi pci debugging: FORCE
85c66be1
BP
65 $(call descend,$@)
66
0041898e
LC
67liblockdep: FORCE
68 $(call descend,lib/lockdep)
69
379a9a28 70libapi: FORCE
553873e1 71 $(call descend,lib/api)
85c66be1 72
16671c1e
JO
73# The perf build does not follow the descend function setup,
74# invoking it via it's own make rule.
75PERF_O = $(if $(O),$(O)/tools/perf,)
76
379a9a28 77perf: FORCE
16671c1e
JO
78 $(Q)mkdir -p $(PERF_O) .
79 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
2363ecb1
BP
80
81selftests: FORCE
ca9dfc6c 82 $(call descend,testing/$@)
2363ecb1
BP
83
84turbostat x86_energy_perf_policy: FORCE
ca9dfc6c 85 $(call descend,power/x86/$@)
2363ecb1 86
94f69966
JP
87tmon: FORCE
88 $(call descend,thermal/$@)
89
b3fd7368
PR
90freefall: FORCE
91 $(call descend,laptop/$@)
92
ee5f7d79
JF
93kvm_stat: FORCE
94 $(call descend,kvm/$@)
95
ecda85e7 96all: acpi cgroup cpupower gpio hv firewire liblockdep \
e9d4650d 97 perf selftests spi turbostat usb \
a92bb546 98 virtio vm bpf x86_energy_perf_policy \
4ab5a5d2
TL
99 tmon freefall iio objtool kvm_stat wmi \
100 pci debugging
f6ba98c5 101
a0c4acc0
LZ
102acpi_install:
103 $(call descend,power/$(@:_install=),install)
104
2363ecb1 105cpupower_install:
ca9dfc6c 106 $(call descend,power/$(@:_install=),install)
2363ecb1 107
4ab5a5d2 108cgroup_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 debugging_install:
ca9dfc6c 109 $(call descend,$(@:_install=),install)
2363ecb1 110
24b4d0a1
AS
111liblockdep_install:
112 $(call descend,lib/lockdep,install)
113
2363ecb1 114selftests_install:
9a13c658 115 $(call descend,testing/$(@:_install=),install)
2363ecb1
BP
116
117turbostat_install x86_energy_perf_policy_install:
ca9dfc6c 118 $(call descend,power/x86/$(@:_install=),install)
2363ecb1 119
94f69966
JP
120tmon_install:
121 $(call descend,thermal/$(@:_install=),install)
122
b3fd7368
PR
123freefall_install:
124 $(call descend,laptop/$(@:_install=),install)
125
f9bc9e65
JF
126kvm_stat_install:
127 $(call descend,kvm/$(@:_install=),install)
128
53499109 129install: acpi_install cgroup_install cpupower_install gpio_install \
bf1d6b2c 130 hv_install firewire_install iio_install liblockdep_install \
92e015b1 131 perf_install selftests_install turbostat_install usb_install \
a92bb546 132 virtio_install vm_install bpf_install x86_energy_perf_policy_install \
9d64fc08 133 tmon_install freefall_install objtool_install kvm_stat_install \
4ab5a5d2 134 wmi_install pci_install debugging_install
2363ecb1 135
a0c4acc0
LZ
136acpi_clean:
137 $(call descend,power/acpi,clean)
138
2363ecb1 139cpupower_clean:
ca9dfc6c 140 $(call descend,power/cpupower,clean)
2363ecb1 141
4ab5a5d2 142cgroup_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 debugging_clean:
85c66be1
BP
143 $(call descend,$(@:_clean=),clean)
144
0041898e
LC
145liblockdep_clean:
146 $(call descend,lib/lockdep,clean)
147
379a9a28 148libapi_clean:
553873e1 149 $(call descend,lib/api,clean)
85c66be1 150
2f5a7f1d
JO
151libbpf_clean:
152 $(call descend,lib/bpf,clean)
153
154libsubcmd_clean:
155 $(call descend,lib/subcmd,clean)
156
379a9a28 157perf_clean:
ab362f5a
JO
158 $(Q)mkdir -p $(PERF_O) .
159 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
2363ecb1
BP
160
161selftests_clean:
ca9dfc6c 162 $(call descend,testing/$(@:_clean=),clean)
2363ecb1
BP
163
164turbostat_clean x86_energy_perf_policy_clean:
ca9dfc6c 165 $(call descend,power/x86/$(@:_clean=),clean)
2363ecb1 166
94f69966
JP
167tmon_clean:
168 $(call descend,thermal/tmon,clean)
169
b3fd7368
PR
170freefall_clean:
171 $(call descend,laptop/freefall,clean)
172
2f5a7f1d
JO
173build_clean:
174 $(call descend,build,clean)
175
ecda85e7 176clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean \
5eca4d84 177 perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
a92bb546 178 vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
6d591c46 179 freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
4ab5a5d2 180 gpio_clean objtool_clean leds_clean wmi_clean pci_clean debugging_clean
2363ecb1
BP
181
182.PHONY: FORCE