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