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