blob: b35102721cbbc82d1560ae657d41cebebe2fa723 [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 ''
Lv Zhenga0c4acc2014-01-15 12:04:17 +080011 @echo ' acpi - ACPI tools'
Greg Thelen92e015b12013-01-04 13:05:17 -080012 @echo ' cgroup - cgroup tools'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020013 @echo ' cpupower - a tool for all things x86 CPU power'
14 @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000015 @echo ' hv - tools used when in Hyper-V clients'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020016 @echo ' lguest - a minimal 32-bit x86 hypervisor'
17 @echo ' perf - Linux performance measurement and analysis tool'
18 @echo ' selftests - various kernel selftests'
19 @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
20 @echo ' usb - USB testing tools'
21 @echo ' virtio - vhost test module'
Daniel Borkmanne306e2c2013-03-20 12:11:47 +000022 @echo ' net - misc networking tools'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020023 @echo ' vm - misc vm tools'
24 @echo ' x86_energy_perf_policy - Intel energy policy tool'
Jacob Pan94f69962013-10-14 16:02:27 -070025 @echo ' tmon - thermal monitoring and tuning tool'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020026 @echo ''
Borislav Petkovea01fa92012-04-11 18:36:18 +020027 @echo 'You can do:'
Borislav Petkov7e010562013-01-29 11:48:11 +010028 @echo ' $$ make -C tools/ <tool>_install'
Borislav Petkovea01fa92012-04-11 18:36:18 +020029 @echo ''
30 @echo ' from the kernel command line to build and install one of'
31 @echo ' the tools above'
32 @echo ''
33 @echo ' $$ make tools/install'
34 @echo ''
35 @echo ' installs all tools.'
36 @echo ''
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020037 @echo 'Cleaning targets:'
38 @echo ''
39 @echo ' all of the above with the "_clean" string appended cleans'
40 @echo ' the respective build directory.'
41 @echo ' clean: a summary clean target to clean _all_ folders'
42
Lv Zhenga0c4acc2014-01-15 12:04:17 +080043acpi: FORCE
44 $(call descend,power/$@)
45
Borislav Petkov2363ecb2012-04-11 18:36:16 +020046cpupower: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000047 $(call descend,power/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020048
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000049cgroup firewire hv guest usb virtio vm net: FORCE
Borislav Petkov85c66be2013-02-20 16:32:30 +010050 $(call descend,$@)
51
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -040052liblockdep: FORCE
53 $(call descend,lib/lockdep)
54
Jiri Olsa379a9a22015-04-18 22:34:38 +020055libapi: FORCE
Borislav Petkov553873e2013-12-09 17:14:23 +010056 $(call descend,lib/api)
Borislav Petkov85c66be2013-02-20 16:32:30 +010057
Jiri Olsa16671c12015-04-18 22:34:39 +020058# The perf build does not follow the descend function setup,
59# invoking it via it's own make rule.
60PERF_O = $(if $(O),$(O)/tools/perf,)
61
Jiri Olsa379a9a22015-04-18 22:34:38 +020062perf: FORCE
Jiri Olsa16671c12015-04-18 22:34:39 +020063 $(Q)mkdir -p $(PERF_O) .
64 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
Borislav Petkov2363ecb2012-04-11 18:36:16 +020065
66selftests: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000067 $(call descend,testing/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020068
69turbostat x86_energy_perf_policy: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000070 $(call descend,power/x86/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020071
Jacob Pan94f69962013-10-14 16:02:27 -070072tmon: FORCE
73 $(call descend,thermal/$@)
74
Lv Zhenga0c4acc2014-01-15 12:04:17 +080075acpi_install:
76 $(call descend,power/$(@:_install=),install)
77
Borislav Petkov2363ecb2012-04-11 18:36:16 +020078cpupower_install:
David Howellsca9dfc62012-11-05 15:15:24 +000079 $(call descend,power/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020080
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000081cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install:
David Howellsca9dfc62012-11-05 15:15:24 +000082 $(call descend,$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020083
84selftests_install:
David Howellsca9dfc62012-11-05 15:15:24 +000085 $(call descend,testing/$(@:_clean=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020086
87turbostat_install x86_energy_perf_policy_install:
David Howellsca9dfc62012-11-05 15:15:24 +000088 $(call descend,power/x86/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020089
Jacob Pan94f69962013-10-14 16:02:27 -070090tmon_install:
91 $(call descend,thermal/$(@:_install=),install)
92
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000093install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
Greg Thelen92e015b12013-01-04 13:05:17 -080094 perf_install selftests_install turbostat_install usb_install \
Jacob Pan94f69962013-10-14 16:02:27 -070095 virtio_install vm_install net_install x86_energy_perf_policy_install \
96 tmon
Borislav Petkov2363ecb2012-04-11 18:36:16 +020097
Lv Zhenga0c4acc2014-01-15 12:04:17 +080098acpi_clean:
99 $(call descend,power/acpi,clean)
100
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200101cpupower_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000102 $(call descend,power/cpupower,clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200103
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000104cgroup_clean hv_clean firewire_clean lguest_clean usb_clean virtio_clean vm_clean net_clean:
Borislav Petkov85c66be2013-02-20 16:32:30 +0100105 $(call descend,$(@:_clean=),clean)
106
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -0400107liblockdep_clean:
108 $(call descend,lib/lockdep,clean)
109
Jiri Olsa379a9a22015-04-18 22:34:38 +0200110libapi_clean:
Borislav Petkov553873e2013-12-09 17:14:23 +0100111 $(call descend,lib/api,clean)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100112
Jiri Olsa379a9a22015-04-18 22:34:38 +0200113perf_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000114 $(call descend,$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200115
116selftests_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000117 $(call descend,testing/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200118
119turbostat_clean x86_energy_perf_policy_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000120 $(call descend,power/x86/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200121
Jacob Pan94f69962013-10-14 16:02:27 -0700122tmon_clean:
123 $(call descend,thermal/tmon,clean)
124
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000125clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
Lv Zhenga0c4acc2014-01-15 12:04:17 +0800126 perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
Jacob Pan94f69962013-10-14 16:02:27 -0700127 vm_clean net_clean x86_energy_perf_policy_clean tmon_clean
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200128
129.PHONY: FORCE