blob: b113078fb7adcb51098bc59e21eea162fd8a3965 [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 Thelen92e015b2013-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'
Pali Rohárb3fd7362015-06-06 15:42:28 +020026 @echo ' freefall - laptop accelerometer program for disk protection'
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020027 @echo ''
Borislav Petkovea01fa92012-04-11 18:36:18 +020028 @echo 'You can do:'
Borislav Petkov7e010562013-01-29 11:48:11 +010029 @echo ' $$ make -C tools/ <tool>_install'
Borislav Petkovea01fa92012-04-11 18:36:18 +020030 @echo ''
31 @echo ' from the kernel command line to build and install one of'
32 @echo ' the tools above'
33 @echo ''
34 @echo ' $$ make tools/install'
35 @echo ''
36 @echo ' installs all tools.'
37 @echo ''
Borislav Petkovd5dd8af2012-04-11 18:36:17 +020038 @echo 'Cleaning targets:'
39 @echo ''
40 @echo ' all of the above with the "_clean" string appended cleans'
41 @echo ' the respective build directory.'
42 @echo ' clean: a summary clean target to clean _all_ folders'
43
Lv Zhenga0c4acc2014-01-15 12:04:17 +080044acpi: FORCE
45 $(call descend,power/$@)
46
Borislav Petkov2363ecb2012-04-11 18:36:16 +020047cpupower: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000048 $(call descend,power/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020049
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000050cgroup firewire hv guest usb virtio vm net: FORCE
Borislav Petkov85c66be2013-02-20 16:32:30 +010051 $(call descend,$@)
52
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -040053liblockdep: FORCE
54 $(call descend,lib/lockdep)
55
Jiri Olsa379a9a22015-04-18 22:34:38 +020056libapi: FORCE
Borislav Petkov553873e2013-12-09 17:14:23 +010057 $(call descend,lib/api)
Borislav Petkov85c66be2013-02-20 16:32:30 +010058
Jiri Olsa16671c12015-04-18 22:34:39 +020059# The perf build does not follow the descend function setup,
60# invoking it via it's own make rule.
61PERF_O = $(if $(O),$(O)/tools/perf,)
62
Jiri Olsa379a9a22015-04-18 22:34:38 +020063perf: FORCE
Jiri Olsa16671c12015-04-18 22:34:39 +020064 $(Q)mkdir -p $(PERF_O) .
65 $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
Borislav Petkov2363ecb2012-04-11 18:36:16 +020066
67selftests: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000068 $(call descend,testing/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020069
70turbostat x86_energy_perf_policy: FORCE
David Howellsca9dfc62012-11-05 15:15:24 +000071 $(call descend,power/x86/$@)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020072
Jacob Pan94f69962013-10-14 16:02:27 -070073tmon: FORCE
74 $(call descend,thermal/$@)
75
Pali Rohárb3fd7362015-06-06 15:42:28 +020076freefall: FORCE
77 $(call descend,laptop/$@)
78
Lv Zhenga0c4acc2014-01-15 12:04:17 +080079acpi_install:
80 $(call descend,power/$(@:_install=),install)
81
Borislav Petkov2363ecb2012-04-11 18:36:16 +020082cpupower_install:
David Howellsca9dfc62012-11-05 15:15:24 +000083 $(call descend,power/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020084
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000085cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install:
David Howellsca9dfc62012-11-05 15:15:24 +000086 $(call descend,$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020087
88selftests_install:
David Howellsca9dfc62012-11-05 15:15:24 +000089 $(call descend,testing/$(@:_clean=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020090
91turbostat_install x86_energy_perf_policy_install:
David Howellsca9dfc62012-11-05 15:15:24 +000092 $(call descend,power/x86/$(@:_install=),install)
Borislav Petkov2363ecb2012-04-11 18:36:16 +020093
Jacob Pan94f69962013-10-14 16:02:27 -070094tmon_install:
95 $(call descend,thermal/$(@:_install=),install)
96
Pali Rohárb3fd7362015-06-06 15:42:28 +020097freefall_install:
98 $(call descend,laptop/$(@:_install=),install)
99
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000100install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
Greg Thelen92e015b2013-01-04 13:05:17 -0800101 perf_install selftests_install turbostat_install usb_install \
Jacob Pan94f69962013-10-14 16:02:27 -0700102 virtio_install vm_install net_install x86_energy_perf_policy_install \
Pali Rohárb3fd7362015-06-06 15:42:28 +0200103 tmon freefall_install
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200104
Lv Zhenga0c4acc2014-01-15 12:04:17 +0800105acpi_clean:
106 $(call descend,power/acpi,clean)
107
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200108cpupower_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000109 $(call descend,power/cpupower,clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200110
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000111cgroup_clean hv_clean firewire_clean lguest_clean usb_clean virtio_clean vm_clean net_clean:
Borislav Petkov85c66be2013-02-20 16:32:30 +0100112 $(call descend,$(@:_clean=),clean)
113
S. Lockwood-Childs0041898e2014-05-08 13:34:01 -0400114liblockdep_clean:
115 $(call descend,lib/lockdep,clean)
116
Jiri Olsa379a9a22015-04-18 22:34:38 +0200117libapi_clean:
Borislav Petkov553873e2013-12-09 17:14:23 +0100118 $(call descend,lib/api,clean)
Borislav Petkov85c66be2013-02-20 16:32:30 +0100119
Jiri Olsa379a9a22015-04-18 22:34:38 +0200120perf_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000121 $(call descend,$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200122
123selftests_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000124 $(call descend,testing/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200125
126turbostat_clean x86_energy_perf_policy_clean:
David Howellsca9dfc62012-11-05 15:15:24 +0000127 $(call descend,power/x86/$(@:_clean=),clean)
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200128
Jacob Pan94f69962013-10-14 16:02:27 -0700129tmon_clean:
130 $(call descend,thermal/tmon,clean)
131
Pali Rohárb3fd7362015-06-06 15:42:28 +0200132freefall_clean:
133 $(call descend,laptop/freefall,clean)
134
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +0000135clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
Lv Zhenga0c4acc2014-01-15 12:04:17 +0800136 perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
Pali Rohárb3fd7362015-06-06 15:42:28 +0200137 vm_clean net_clean x86_energy_perf_policy_clean tmon_clean freefall_clean
Borislav Petkov2363ecb2012-04-11 18:36:16 +0200138
139.PHONY: FORCE