Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Jiri Olsa | 16671c1 | 2015-04-18 22:34:39 +0200 | [diff] [blame] | 2 | # Some of the tools (perf) use same make variables |
| 3 | # as in kernel build. |
| 4 | export srctree= |
| 5 | export objtree= |
| 6 | |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 7 | include scripts/Makefile.include |
| 8 | |
Borislav Petkov | d5dd8af | 2012-04-11 18:36:17 +0200 | [diff] [blame] | 9 | help: |
| 10 | @echo 'Possible targets:' |
| 11 | @echo '' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 12 | @echo ' acpi - ACPI tools' |
Andy Shevchenko | 38fe26b | 2019-06-28 20:22:09 +0300 | [diff] [blame] | 13 | @echo ' bpf - misc BPF tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 14 | @echo ' cgroup - cgroup tools' |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 15 | @echo ' counter - counter tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 16 | @echo ' cpupower - a tool for all things x86 CPU power' |
Thorsten Leemhuis | 4ab5a5d | 2019-01-08 20:40:06 +0100 | [diff] [blame] | 17 | @echo ' debugging - tools for debugging' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 18 | @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer' |
Andrey Smirnov | 1e51060 | 2018-10-17 11:27:18 -0700 | [diff] [blame] | 19 | @echo ' firmware - Firmware tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 20 | @echo ' freefall - laptop accelerometer program for disk protection' |
Linus Walleij | 6d591c4 | 2015-10-21 15:45:54 +0200 | [diff] [blame] | 21 | @echo ' gpio - GPIO tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 22 | @echo ' hv - tools used when in Hyper-V clients' |
| 23 | @echo ' iio - IIO tools' |
Srinivas Pandruvada | 3fb4f7c | 2019-06-30 10:14:08 -0700 | [diff] [blame] | 24 | @echo ' intel-speed-select - Intel Speed Select tool' |
Janosch Frank | f9bc9e6 | 2016-05-18 13:26:21 +0200 | [diff] [blame] | 25 | @echo ' kvm_stat - top-like utility for displaying kvm statistics' |
David Lechner | fa7f324 | 2016-09-16 14:16:50 -0500 | [diff] [blame] | 26 | @echo ' leds - LEDs tools' |
Andy Shevchenko | 38fe26b | 2019-06-28 20:22:09 +0300 | [diff] [blame] | 27 | @echo ' objtool - an ELF object analysis tool' |
Gustavo Pimentel | 1ce78ce | 2018-08-23 13:55:15 +0200 | [diff] [blame] | 28 | @echo ' pci - PCI tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 29 | @echo ' perf - Linux performance measurement and analysis tool' |
| 30 | @echo ' selftests - various kernel selftests' |
Masami Hiramatsu | 950313e | 2020-01-11 01:03:56 +0900 | [diff] [blame] | 31 | @echo ' bootconfig - boot config tool' |
Linus Torvalds | 747a9b0 | 2016-01-14 11:39:09 -0800 | [diff] [blame] | 32 | @echo ' spi - spi tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 33 | @echo ' tmon - thermal monitoring and tuning tool' |
Viktor Rosendahl | e23db80 | 2021-02-12 14:44:21 +0100 | [diff] [blame] | 34 | @echo ' tracing - misc tracing tools' |
Josh Poimboeuf | 20a7add | 2015-12-18 06:39:15 -0600 | [diff] [blame] | 35 | @echo ' turbostat - Intel CPU idle stats and freq reporting tool' |
| 36 | @echo ' usb - USB testing tools' |
| 37 | @echo ' virtio - vhost test module' |
| 38 | @echo ' vm - misc vm tools' |
Mario Limonciello | 9d64fc0 | 2017-11-01 14:25:37 -0500 | [diff] [blame] | 39 | @echo ' wmi - WMI interface examples' |
Borislav Petkov | d5dd8af | 2012-04-11 18:36:17 +0200 | [diff] [blame] | 40 | @echo ' x86_energy_perf_policy - Intel energy policy tool' |
| 41 | @echo '' |
Borislav Petkov | ea01fa9 | 2012-04-11 18:36:18 +0200 | [diff] [blame] | 42 | @echo 'You can do:' |
Borislav Petkov | 7e01056 | 2013-01-29 11:48:11 +0100 | [diff] [blame] | 43 | @echo ' $$ make -C tools/ <tool>_install' |
Borislav Petkov | ea01fa9 | 2012-04-11 18:36:18 +0200 | [diff] [blame] | 44 | @echo '' |
| 45 | @echo ' from the kernel command line to build and install one of' |
| 46 | @echo ' the tools above' |
| 47 | @echo '' |
Kamal Mostafa | f6ba98c | 2015-11-11 14:25:34 -0800 | [diff] [blame] | 48 | @echo ' $$ make tools/all' |
| 49 | @echo '' |
| 50 | @echo ' builds all tools.' |
| 51 | @echo '' |
Borislav Petkov | ea01fa9 | 2012-04-11 18:36:18 +0200 | [diff] [blame] | 52 | @echo ' $$ make tools/install' |
| 53 | @echo '' |
| 54 | @echo ' installs all tools.' |
| 55 | @echo '' |
Borislav Petkov | d5dd8af | 2012-04-11 18:36:17 +0200 | [diff] [blame] | 56 | @echo 'Cleaning targets:' |
| 57 | @echo '' |
| 58 | @echo ' all of the above with the "_clean" string appended cleans' |
| 59 | @echo ' the respective build directory.' |
| 60 | @echo ' clean: a summary clean target to clean _all_ folders' |
| 61 | |
Lv Zheng | a0c4acc | 2014-01-15 12:04:17 +0800 | [diff] [blame] | 62 | acpi: FORCE |
| 63 | $(call descend,power/$@) |
| 64 | |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 65 | cpupower: FORCE |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 66 | $(call descend,power/$@) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 67 | |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 68 | cgroup counter firewire hv guest bootconfig spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 69 | $(call descend,$@) |
| 70 | |
Jiri Olsa | 33a57ce | 2020-07-11 23:53:22 +0200 | [diff] [blame] | 71 | bpf/%: FORCE |
| 72 | $(call descend,$@) |
| 73 | |
Jiri Olsa | 379a9a2 | 2015-04-18 22:34:38 +0200 | [diff] [blame] | 74 | libapi: FORCE |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 75 | $(call descend,lib/api) |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 76 | |
Jiri Olsa | 16671c1 | 2015-04-18 22:34:39 +0200 | [diff] [blame] | 77 | # The perf build does not follow the descend function setup, |
| 78 | # invoking it via it's own make rule. |
| 79 | PERF_O = $(if $(O),$(O)/tools/perf,) |
| 80 | |
Jiri Olsa | 379a9a2 | 2015-04-18 22:34:38 +0200 | [diff] [blame] | 81 | perf: FORCE |
Jiri Olsa | 16671c1 | 2015-04-18 22:34:39 +0200 | [diff] [blame] | 82 | $(Q)mkdir -p $(PERF_O) . |
| 83 | $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 84 | |
| 85 | selftests: FORCE |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 86 | $(call descend,testing/$@) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 87 | |
Srinivas Pandruvada | 3fb4f7c | 2019-06-30 10:14:08 -0700 | [diff] [blame] | 88 | turbostat x86_energy_perf_policy intel-speed-select: FORCE |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 89 | $(call descend,power/x86/$@) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 90 | |
Jacob Pan | 94f6996 | 2013-10-14 16:02:27 -0700 | [diff] [blame] | 91 | tmon: FORCE |
| 92 | $(call descend,thermal/$@) |
| 93 | |
Pali Rohár | b3fd736 | 2015-06-06 15:42:28 +0200 | [diff] [blame] | 94 | freefall: FORCE |
| 95 | $(call descend,laptop/$@) |
| 96 | |
Justin M. Forbes | ee5f7d7 | 2017-04-11 10:34:35 -0500 | [diff] [blame] | 97 | kvm_stat: FORCE |
| 98 | $(call descend,kvm/$@) |
| 99 | |
Sasha Levin | 7246f4d | 2021-11-12 10:16:02 -0500 | [diff] [blame] | 100 | all: acpi cgroup counter cpupower gpio hv firewire \ |
Masami Hiramatsu | 950313e | 2020-01-11 01:03:56 +0900 | [diff] [blame] | 101 | perf selftests bootconfig spi turbostat usb \ |
Jakub Kicinski | a92bb54 | 2017-10-04 20:10:03 -0700 | [diff] [blame] | 102 | virtio vm bpf x86_energy_perf_policy \ |
Thorsten Leemhuis | 4ab5a5d | 2019-01-08 20:40:06 +0100 | [diff] [blame] | 103 | tmon freefall iio objtool kvm_stat wmi \ |
Viktor Rosendahl | e23db80 | 2021-02-12 14:44:21 +0100 | [diff] [blame] | 104 | pci debugging tracing |
Kamal Mostafa | f6ba98c | 2015-11-11 14:25:34 -0800 | [diff] [blame] | 105 | |
Lv Zheng | a0c4acc | 2014-01-15 12:04:17 +0800 | [diff] [blame] | 106 | acpi_install: |
| 107 | $(call descend,power/$(@:_install=),install) |
| 108 | |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 109 | cpupower_install: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 110 | $(call descend,power/$(@:_install=),install) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 111 | |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 112 | cgroup_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: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 113 | $(call descend,$(@:_install=),install) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 114 | |
| 115 | selftests_install: |
Kevin Hilman | 9a13c65 | 2015-11-17 13:54:19 -0800 | [diff] [blame] | 116 | $(call descend,testing/$(@:_install=),install) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 117 | |
Srinivas Pandruvada | 3fb4f7c | 2019-06-30 10:14:08 -0700 | [diff] [blame] | 118 | turbostat_install x86_energy_perf_policy_install intel-speed-select_install: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 119 | $(call descend,power/x86/$(@:_install=),install) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 120 | |
Jacob Pan | 94f6996 | 2013-10-14 16:02:27 -0700 | [diff] [blame] | 121 | tmon_install: |
| 122 | $(call descend,thermal/$(@:_install=),install) |
| 123 | |
Pali Rohár | b3fd736 | 2015-06-06 15:42:28 +0200 | [diff] [blame] | 124 | freefall_install: |
| 125 | $(call descend,laptop/$(@:_install=),install) |
| 126 | |
Janosch Frank | f9bc9e6 | 2016-05-18 13:26:21 +0200 | [diff] [blame] | 127 | kvm_stat_install: |
| 128 | $(call descend,kvm/$(@:_install=),install) |
| 129 | |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 130 | install: acpi_install cgroup_install counter_install cpupower_install gpio_install \ |
Sasha Levin | 7246f4d | 2021-11-12 10:16:02 -0500 | [diff] [blame] | 131 | hv_install firewire_install iio_install \ |
Greg Thelen | 92e015b1 | 2013-01-04 13:05:17 -0800 | [diff] [blame] | 132 | perf_install selftests_install turbostat_install usb_install \ |
Jakub Kicinski | a92bb54 | 2017-10-04 20:10:03 -0700 | [diff] [blame] | 133 | virtio_install vm_install bpf_install x86_energy_perf_policy_install \ |
Mario Limonciello | 9d64fc0 | 2017-11-01 14:25:37 -0500 | [diff] [blame] | 134 | tmon_install freefall_install objtool_install kvm_stat_install \ |
Viktor Rosendahl | e23db80 | 2021-02-12 14:44:21 +0100 | [diff] [blame] | 135 | wmi_install pci_install debugging_install intel-speed-select_install \ |
| 136 | tracing_install |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 137 | |
Lv Zheng | a0c4acc | 2014-01-15 12:04:17 +0800 | [diff] [blame] | 138 | acpi_clean: |
| 139 | $(call descend,power/acpi,clean) |
| 140 | |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 141 | cpupower_clean: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 142 | $(call descend,power/cpupower,clean) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 143 | |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 144 | cgroup_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: |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 145 | $(call descend,$(@:_clean=),clean) |
| 146 | |
Jiri Olsa | 379a9a2 | 2015-04-18 22:34:38 +0200 | [diff] [blame] | 147 | libapi_clean: |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 148 | $(call descend,lib/api,clean) |
Borislav Petkov | 85c66be | 2013-02-20 16:32:30 +0100 | [diff] [blame] | 149 | |
Jiri Olsa | 2f5a7f1 | 2016-01-11 11:54:48 +0100 | [diff] [blame] | 150 | libbpf_clean: |
| 151 | $(call descend,lib/bpf,clean) |
| 152 | |
| 153 | libsubcmd_clean: |
| 154 | $(call descend,lib/subcmd,clean) |
| 155 | |
Jiri Olsa | 379a9a2 | 2015-04-18 22:34:38 +0200 | [diff] [blame] | 156 | perf_clean: |
Jiri Olsa | ab362f5 | 2016-04-25 22:17:18 +0200 | [diff] [blame] | 157 | $(Q)mkdir -p $(PERF_O) . |
| 158 | $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 159 | |
| 160 | selftests_clean: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 161 | $(call descend,testing/$(@:_clean=),clean) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 162 | |
Srinivas Pandruvada | 3fb4f7c | 2019-06-30 10:14:08 -0700 | [diff] [blame] | 163 | turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean: |
David Howells | ca9dfc6 | 2012-11-05 15:15:24 +0000 | [diff] [blame] | 164 | $(call descend,power/x86/$(@:_clean=),clean) |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 165 | |
Jacob Pan | 94f6996 | 2013-10-14 16:02:27 -0700 | [diff] [blame] | 166 | tmon_clean: |
| 167 | $(call descend,thermal/tmon,clean) |
| 168 | |
Pali Rohár | b3fd736 | 2015-06-06 15:42:28 +0200 | [diff] [blame] | 169 | freefall_clean: |
| 170 | $(call descend,laptop/freefall,clean) |
| 171 | |
Jiri Olsa | 2f5a7f1 | 2016-01-11 11:54:48 +0100 | [diff] [blame] | 172 | build_clean: |
| 173 | $(call descend,build,clean) |
| 174 | |
William Breathitt Gray | 0860998 | 2021-09-29 12:16:01 +0900 | [diff] [blame] | 175 | clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \ |
Masami Hiramatsu | 950313e | 2020-01-11 01:03:56 +0900 | [diff] [blame] | 176 | perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \ |
Jakub Kicinski | a92bb54 | 2017-10-04 20:10:03 -0700 | [diff] [blame] | 177 | vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \ |
Sasha Levin | 7246f4d | 2021-11-12 10:16:02 -0500 | [diff] [blame] | 178 | freefall_clean build_clean libbpf_clean libsubcmd_clean \ |
Srinivas Pandruvada | 3fb4f7c | 2019-06-30 10:14:08 -0700 | [diff] [blame] | 179 | gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \ |
Viktor Rosendahl | e23db80 | 2021-02-12 14:44:21 +0100 | [diff] [blame] | 180 | intel-speed-select_clean tracing_clean |
Borislav Petkov | 2363ecb | 2012-04-11 18:36:16 +0200 | [diff] [blame] | 181 | |
| 182 | .PHONY: FORCE |