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