Merge tag 'driver-core-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / tools / Makefile
1 # Some of the tools (perf) use same make variables
2 # as in kernel build.
3 export srctree=
4 export objtree=
5
6 include scripts/Makefile.include
7
8 help:
9         @echo 'Possible targets:'
10         @echo ''
11         @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 '  hv         - tools used when in Hyper-V clients'
16         @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'
22         @echo '  net        - misc networking tools'
23         @echo '  vm         - misc vm tools'
24         @echo '  x86_energy_perf_policy - Intel energy policy tool'
25         @echo '  tmon       - thermal monitoring and tuning tool'
26         @echo '  freefall   - laptop accelerometer program for disk protection'
27         @echo ''
28         @echo 'You can do:'
29         @echo ' $$ make -C tools/ <tool>_install'
30         @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 ''
38         @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
44 acpi: FORCE
45         $(call descend,power/$@)
46
47 cpupower: FORCE
48         $(call descend,power/$@)
49
50 cgroup firewire hv guest usb virtio vm net: FORCE
51         $(call descend,$@)
52
53 liblockdep: FORCE
54         $(call descend,lib/lockdep)
55
56 libapi: FORCE
57         $(call descend,lib/api)
58
59 # The perf build does not follow the descend function setup,
60 # invoking it via it's own make rule.
61 PERF_O   = $(if $(O),$(O)/tools/perf,)
62
63 perf: FORCE
64         $(Q)mkdir -p $(PERF_O) .
65         $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
66
67 selftests: FORCE
68         $(call descend,testing/$@)
69
70 turbostat x86_energy_perf_policy: FORCE
71         $(call descend,power/x86/$@)
72
73 tmon: FORCE
74         $(call descend,thermal/$@)
75
76 freefall: FORCE
77         $(call descend,laptop/$@)
78
79 acpi_install:
80         $(call descend,power/$(@:_install=),install)
81
82 cpupower_install:
83         $(call descend,power/$(@:_install=),install)
84
85 cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install:
86         $(call descend,$(@:_install=),install)
87
88 selftests_install:
89         $(call descend,testing/$(@:_clean=),install)
90
91 turbostat_install x86_energy_perf_policy_install:
92         $(call descend,power/x86/$(@:_install=),install)
93
94 tmon_install:
95         $(call descend,thermal/$(@:_install=),install)
96
97 freefall_install:
98         $(call descend,laptop/$(@:_install=),install)
99
100 install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
101                 perf_install selftests_install turbostat_install usb_install \
102                 virtio_install vm_install net_install x86_energy_perf_policy_install \
103                 tmon freefall_install
104
105 acpi_clean:
106         $(call descend,power/acpi,clean)
107
108 cpupower_clean:
109         $(call descend,power/cpupower,clean)
110
111 cgroup_clean hv_clean firewire_clean lguest_clean usb_clean virtio_clean vm_clean net_clean:
112         $(call descend,$(@:_clean=),clean)
113
114 liblockdep_clean:
115         $(call descend,lib/lockdep,clean)
116
117 libapi_clean:
118         $(call descend,lib/api,clean)
119
120 perf_clean:
121         $(call descend,$(@:_clean=),clean)
122
123 selftests_clean:
124         $(call descend,testing/$(@:_clean=),clean)
125
126 turbostat_clean x86_energy_perf_policy_clean:
127         $(call descend,power/x86/$(@:_clean=),clean)
128
129 tmon_clean:
130         $(call descend,thermal/tmon,clean)
131
132 freefall_clean:
133         $(call descend,laptop/freefall,clean)
134
135 clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
136                 perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
137                 vm_clean net_clean x86_energy_perf_policy_clean tmon_clean freefall_clean
138
139 .PHONY: FORCE