blob: f41e7c6ea23e241d06c2941eef92053b2ad920ba [file] [log] [blame]
Jiri Olsa16671c12015-04-18 22:34:39 +02001# Some of the tools (perf) use same make variables
2# as in kernel build.
3export srctree=
4export objtree=
5
Borislav Petkov2363ecb2012-04-11 18:36:16 +02006include scripts/Makefile.include
7
Borislav Petkovd5dd8af2012-04-11 18:36:17 +02008help:
9 @echo 'Possible targets:'
10 @echo ''
Josh Poimboeuf20a7add2015-12-18 06:39:15 -060011 @echo ' acpi - ACPI tools'
12 @echo ' cgroup - cgroup tools'
13 @echo ' cpupower - a tool for all things x86 CPU power'
14 @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
15 @echo ' freefall - laptop accelerometer program for disk protection'
Linus Walleij6d591c42015-10-21 15:45:54 +020016 @echo ' gpio - GPIO tools'
Josh Poimboeuf20a7add2015-12-18 06:39:15 -060017 @echo ' hv - tools used when in Hyper-V clients'
18 @echo ' iio - IIO tools'
19 @echo ' lguest - a minimal 32-bit x86 hypervisor'
20 @echo ' net - misc networking tools'
21 @echo ' perf - Linux performance measurement and analysis tool'
22 @echo ' selftests - various kernel selftests'
Linus Torvalds747a9b02016-01-14 11:39:09 -080023 @echo ' spi - spi tools'
Josh Poimboeuf20a7add2015-12-18 06:39:15 -060024 @echo ' tmon - thermal monitoring and tuning tool'
25 @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
26 @echo ' usb - USB testing tools'
27 @echo ' virtio - vhost test module'
28 @echo ' vm - misc vm tools'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020029 @echo ' x86_energy_perf_policy - Intel energy policy tool'
30 @echo ''
Borislav Petkovea01fa92012-04-11 18:36:18 +020031 @echo 'You can do:'
Borislav Petkov7e010562013-01-29 11:48:11 +010032 @echo ' $$ make -C tools/ <tool>_install'
Borislav Petkovea01fa92012-04-11 18:36:18 +020033 @echo ''
34 @echo ' from the kernel command line to build and install one of'
35 @echo ' the tools above'
36 @echo ''
Kamal Mostafaf6ba98c2015-11-11 14:25:34 -080037 @echo ' $$ make tools/all'
38 @echo ''
39 @echo ' builds all tools.'
40 @echo ''
Borislav Petkovea01fa92012-04-11 18:36:18 +020041 @echo ' $$ make tools/install'
42 @echo ''
43 @echo ' installs all tools.'
44 @echo ''
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020045 @echo 'Cleaning targets:'
46 @echo ''
47 @echo ' all of the above with the "_clean" string appended cleans'
48 @echo ' the respective build directory.'
49 @echo ' clean: a summary clean target to clean _all_ folders'
50
Lv Zhenga0c4acc2014-01-15 12:04:17 +080051acpi: FORCE
52 $(call descend,power/$@)
53
Borislav Petkov2363ecb2012-04-11 18:36:16 +020054cpupower: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000055 $(call descend,power/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020056
Linus Walleij6d591c42015-10-21 15:45:54 +020057cgroup firewire hv guest spi usb virtio vm net iio gpio: FORCE
Borislav Petkov85c66be2013-02-20 16:32:30 +010058 $(call descend,$@)
59
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -040060liblockdep: FORCE
61 $(call descend,lib/lockdep)
62
Jiri Olsa379a9a22015-04-18 22:34:38 +020063libapi: FORCE
Borislav Petkov553873e2013-12-09 17:14:23 +010064 $(call descend,lib/api)
Borislav Petkov85c66be2013-02-20 16:32:30 +010065
Jiri Olsa16671c12015-04-18 22:34:39 +020066# The perf build does not follow the descend function setup,
67# invoking it via it's own make rule.
68PERF_O = $(if $(O),$(O)/tools/perf,)
69
Jiri Olsa379a9a22015-04-18 22:34:38 +020070perf: FORCE
Jiri Olsa16671c12015-04-18 22:34:39 +020071 $(Q)mkdir -p $(PERF_O) .
72 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
Borislav Petkov2363ecb2012-04-11 18:36:16 +020073
74selftests: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000075 $(call descend,testing/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020076
77turbostat x86_energy_perf_policy: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000078 $(call descend,power/x86/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020079
Jacob Pan94f69962013-10-14 16:02:27 -070080tmon: FORCE
81 $(call descend,thermal/$@)
82
Pali Rohárb3fd7362015-06-06 15:42:28 +020083freefall: FORCE
84 $(call descend,laptop/$@)
85
Kamal Mostafaf6ba98c2015-11-11 14:25:34 -080086all: acpi cgroup cpupower hv firewire lguest \
87 perf selftests turbostat usb \
88 virtio vm net x86_energy_perf_policy \
89 tmon freefall
90
Lv Zhenga0c4acc2014-01-15 12:04:17 +080091acpi_install:
92 $(call descend,power/$(@:_install=),install)
93
Borislav Petkov2363ecb2012-04-11 18:36:16 +020094cpupower_install:
David Howellsca9dfc62012-11-05 15:15:24 +000095 $(call descend,power/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020096
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000097cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install:
David Howellsca9dfc62012-11-05 15:15:24 +000098 $(call descend,$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020099
100selftests_install:
Kevin Hilman9a13c652015-11-17 13:54:19 -0800101 $(call descend,testing/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200102
103turbostat_install x86_energy_perf_policy_install:
David Howellsca9dfc62012-11-05 15:15:24 +0000104 $(call descend,power/x86/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200105
Jacob Pan94f69962013-10-14 16:02:27 -0700106tmon_install:
107 $(call descend,thermal/$(@:_install=),install)
108
Pali Rohárb3fd7362015-06-06 15:42:28 +0200109freefall_install:
110 $(call descend,laptop/$(@:_install=),install)
111
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000112install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
Greg Thelen92e015b12013-01-04 13:05:17 -0800113 perf_install selftests_install turbostat_install usb_install \
Jacob Pan94f69962013-10-14 16:02:27 -0700114 virtio_install vm_install net_install x86_energy_perf_policy_install \
Kamal Mostafa836d5252015-11-11 14:25:33 -0800115 tmon_install freefall_install
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200116
Lv Zhenga0c4acc2014-01-15 12:04:17 +0800117acpi_clean:
118 $(call descend,power/acpi,clean)
119
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200120cpupower_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000121 $(call descend,power/cpupower,clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200122
Linus Walleij6d591c42015-10-21 15:45:54 +0200123cgroup_clean hv_clean firewire_clean lguest_clean spi_clean usb_clean virtio_clean vm_clean net_clean iio_clean gpio_clean:
Borislav Petkov85c66be2013-02-20 16:32:30 +0100124 $(call descend,$(@:_clean=),clean)
125
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -0400126liblockdep_clean:
127 $(call descend,lib/lockdep,clean)
128
Jiri Olsa379a9a22015-04-18 22:34:38 +0200129libapi_clean:
Borislav Petkov553873e2013-12-09 17:14:23 +0100130 $(call descend,lib/api,clean)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100131
Jiri Olsa2f5a7f12016-01-11 11:54:48 +0100132libbpf_clean:
133 $(call descend,lib/bpf,clean)
134
135libsubcmd_clean:
136 $(call descend,lib/subcmd,clean)
137
Jiri Olsa379a9a22015-04-18 22:34:38 +0200138perf_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000139 $(call descend,$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200140
141selftests_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000142 $(call descend,testing/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200143
144turbostat_clean x86_energy_perf_policy_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000145 $(call descend,power/x86/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200146
Jacob Pan94f69962013-10-14 16:02:27 -0700147tmon_clean:
148 $(call descend,thermal/tmon,clean)
149
Pali Rohárb3fd7362015-06-06 15:42:28 +0200150freefall_clean:
151 $(call descend,laptop/freefall,clean)
152
Jiri Olsa2f5a7f12016-01-11 11:54:48 +0100153build_clean:
154 $(call descend,build,clean)
155
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000156clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
Joshua Clayton5eca4d82015-11-18 14:30:37 -0800157 perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
Linus Torvalds23908db2015-06-26 15:46:08 -0700158 vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
Linus Walleij6d591c42015-10-21 15:45:54 +0200159 freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
160 gpio_clean
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200161
162.PHONY: FORCE