Blame view

tools/Makefile 5.31 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  # SPDX-License-Identifier: GPL-2.0
16671c1e1   Jiri Olsa   tools build: Fix ...
2
3
4
5
  # Some of the tools (perf) use same make variables
  # as in kernel build.
  export srctree=
  export objtree=
2363ecb17   Borislav Petkov   tools: Add a topl...
6
  include scripts/Makefile.include
d5dd8afb5   Borislav Petkov   tools: Add a help...
7
8
9
  help:
  	@echo 'Possible targets:'
  	@echo ''
20a7add8c   Josh Poimboeuf   tools: Fix format...
10
11
12
13
14
  	@echo '  acpi                   - ACPI tools'
  	@echo '  cgroup                 - cgroup tools'
  	@echo '  cpupower               - a tool for all things x86 CPU power'
  	@echo '  firewire               - the userspace part of nosy, an IEEE-1394 traffic sniffer'
  	@echo '  freefall               - laptop accelerometer program for disk protection'
6d591c46b   Linus Walleij   tools/gpio: creat...
15
  	@echo '  gpio                   - GPIO tools'
20a7add8c   Josh Poimboeuf   tools: Fix format...
16
17
  	@echo '  hv                     - tools used when in Hyper-V clients'
  	@echo '  iio                    - IIO tools'
f9bc9e65f   Janosch Frank   tools: Add kvm_st...
18
  	@echo '  kvm_stat               - top-like utility for displaying kvm statistics'
fa7f32422   David Lechner   tools/leds: Add u...
19
  	@echo '  leds                   - LEDs  tools'
24b4d0a1f   Alexander Sverdlin   tools: Add instal...
20
  	@echo '  liblockdep             - user-space wrapper for kernel locking-validator'
20a7add8c   Josh Poimboeuf   tools: Fix format...
21
22
23
  	@echo '  net                    - misc networking tools'
  	@echo '  perf                   - Linux performance measurement and analysis tool'
  	@echo '  selftests              - various kernel selftests'
747a9b0a0   Linus Torvalds   Merge branch 'per...
24
  	@echo '  spi                    - spi tools'
442f04c34   Josh Poimboeuf   objtool: Add tool...
25
  	@echo '  objtool                - an ELF object analysis tool'
20a7add8c   Josh Poimboeuf   tools: Fix format...
26
27
28
29
30
  	@echo '  tmon                   - thermal monitoring and tuning tool'
  	@echo '  turbostat              - Intel CPU idle stats and freq reporting tool'
  	@echo '  usb                    - USB testing tools'
  	@echo '  virtio                 - vhost test module'
  	@echo '  vm                     - misc vm tools'
d5dd8afb5   Borislav Petkov   tools: Add a help...
31
32
  	@echo '  x86_energy_perf_policy - Intel energy policy tool'
  	@echo ''
ea01fa9f6   Borislav Petkov   tools: Connect to...
33
  	@echo 'You can do:'
7e010562e   Borislav Petkov   tools: Correct ty...
34
  	@echo ' $$ make -C tools/ <tool>_install'
ea01fa9f6   Borislav Petkov   tools: Connect to...
35
36
37
38
  	@echo ''
  	@echo '  from the kernel command line to build and install one of'
  	@echo '  the tools above'
  	@echo ''
f6ba98c5d   Kamal Mostafa   tools: Add a "mak...
39
40
41
42
  	@echo '  $$ make tools/all'
  	@echo ''
  	@echo '  builds all tools.'
  	@echo ''
ea01fa9f6   Borislav Petkov   tools: Connect to...
43
44
45
46
  	@echo '  $$ make tools/install'
  	@echo ''
  	@echo '  installs all tools.'
  	@echo ''
d5dd8afb5   Borislav Petkov   tools: Add a help...
47
48
49
50
51
  	@echo 'Cleaning targets:'
  	@echo ''
  	@echo '  all of the above with the "_clean" string appended cleans'
  	@echo '    the respective build directory.'
  	@echo '  clean: a summary clean target to clean _all_ folders'
a0c4acc09   Lv Zheng   ACPICA: acpidump:...
52
53
  acpi: FORCE
  	$(call descend,power/$@)
2363ecb17   Borislav Petkov   tools: Add a topl...
54
  cpupower: FORCE
ca9dfc6cc   David Howells   tools: Define a M...
55
  	$(call descend,power/$@)
2363ecb17   Borislav Petkov   tools: Add a topl...
56

fa7f32422   David Lechner   tools/leds: Add u...
57
  cgroup firewire hv guest spi usb virtio vm net iio gpio objtool leds: FORCE
85c66be10   Borislav Petkov   perf tools: Intro...
58
  	$(call descend,$@)
0041898ec   S. Lockwood-Childs   tools/liblockdep:...
59
60
  liblockdep: FORCE
  	$(call descend,lib/lockdep)
379a9a28a   Jiri Olsa   tools build: No n...
61
  libapi: FORCE
553873e1d   Borislav Petkov   tools/: Convert t...
62
  	$(call descend,lib/api)
85c66be10   Borislav Petkov   perf tools: Intro...
63

16671c1e1   Jiri Olsa   tools build: Fix ...
64
65
66
  # The perf build does not follow the descend function setup,
  # invoking it via it's own make rule.
  PERF_O   = $(if $(O),$(O)/tools/perf,)
379a9a28a   Jiri Olsa   tools build: No n...
67
  perf: FORCE
16671c1e1   Jiri Olsa   tools build: Fix ...
68
69
  	$(Q)mkdir -p $(PERF_O) .
  	$(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
2363ecb17   Borislav Petkov   tools: Add a topl...
70
71
  
  selftests: FORCE
ca9dfc6cc   David Howells   tools: Define a M...
72
  	$(call descend,testing/$@)
2363ecb17   Borislav Petkov   tools: Add a topl...
73
74
  
  turbostat x86_energy_perf_policy: FORCE
ca9dfc6cc   David Howells   tools: Define a M...
75
  	$(call descend,power/x86/$@)
2363ecb17   Borislav Petkov   tools: Add a topl...
76

94f69966f   Jacob Pan   tools/thermal: In...
77
78
  tmon: FORCE
  	$(call descend,thermal/$@)
b3fd7368f   Pali Rohár   Move freefall pro...
79
80
  freefall: FORCE
  	$(call descend,laptop/$@)
ee5f7d79a   Justin M. Forbes   tools/kvm: fix to...
81
82
  kvm_stat: FORCE
  	$(call descend,kvm/$@)
ecda85e70   Juergen Gross   x86/lguest: Remov...
83
  all: acpi cgroup cpupower gpio hv firewire liblockdep \
e9d4650dc   Andy Shevchenko   spi: tools: add i...
84
  		perf selftests spi turbostat usb \
f6ba98c5d   Kamal Mostafa   tools: Add a "mak...
85
  		virtio vm net x86_energy_perf_policy \
25e3f85aa   Andy Shevchenko   iio: tools: add i...
86
  		tmon freefall iio objtool kvm_stat
f6ba98c5d   Kamal Mostafa   tools: Add a "mak...
87

a0c4acc09   Lv Zheng   ACPICA: acpidump:...
88
89
  acpi_install:
  	$(call descend,power/$(@:_install=),install)
2363ecb17   Borislav Petkov   tools: Add a topl...
90
  cpupower_install:
ca9dfc6cc   David Howells   tools: Define a M...
91
  	$(call descend,power/$(@:_install=),install)
2363ecb17   Borislav Petkov   tools: Add a topl...
92

b88f55774   Linus Torvalds   Merge tag 'spi-v4...
93
  cgroup_install firewire_install gpio_install hv_install iio_install perf_install spi_install usb_install virtio_install vm_install net_install objtool_install:
ca9dfc6cc   David Howells   tools: Define a M...
94
  	$(call descend,$(@:_install=),install)
2363ecb17   Borislav Petkov   tools: Add a topl...
95

24b4d0a1f   Alexander Sverdlin   tools: Add instal...
96
97
  liblockdep_install:
  	$(call descend,lib/lockdep,install)
2363ecb17   Borislav Petkov   tools: Add a topl...
98
  selftests_install:
9a13c6587   Kevin Hilman   tools: Fix selfte...
99
  	$(call descend,testing/$(@:_install=),install)
2363ecb17   Borislav Petkov   tools: Add a topl...
100
101
  
  turbostat_install x86_energy_perf_policy_install:
ca9dfc6cc   David Howells   tools: Define a M...
102
  	$(call descend,power/x86/$(@:_install=),install)
2363ecb17   Borislav Petkov   tools: Add a topl...
103

94f69966f   Jacob Pan   tools/thermal: In...
104
105
  tmon_install:
  	$(call descend,thermal/$(@:_install=),install)
b3fd7368f   Pali Rohár   Move freefall pro...
106
107
  freefall_install:
  	$(call descend,laptop/$(@:_install=),install)
f9bc9e65f   Janosch Frank   tools: Add kvm_st...
108
109
  kvm_stat_install:
  	$(call descend,kvm/$(@:_install=),install)
534991092   Andy Shevchenko   tools/gpio: add i...
110
  install: acpi_install cgroup_install cpupower_install gpio_install \
bf1d6b2c7   Linus Torvalds   Merge tag 'stagin...
111
  		hv_install firewire_install iio_install liblockdep_install \
92e015b1c   Greg Thelen   cgroups: move cgr...
112
  		perf_install selftests_install turbostat_install usb_install \
94f69966f   Jacob Pan   tools/thermal: In...
113
  		virtio_install vm_install net_install x86_energy_perf_policy_install \
f9bc9e65f   Janosch Frank   tools: Add kvm_st...
114
  		tmon_install freefall_install objtool_install kvm_stat_install
2363ecb17   Borislav Petkov   tools: Add a topl...
115

a0c4acc09   Lv Zheng   ACPICA: acpidump:...
116
117
  acpi_clean:
  	$(call descend,power/acpi,clean)
2363ecb17   Borislav Petkov   tools: Add a topl...
118
  cpupower_clean:
ca9dfc6cc   David Howells   tools: Define a M...
119
  	$(call descend,power/cpupower,clean)
2363ecb17   Borislav Petkov   tools: Add a topl...
120

ecda85e70   Juergen Gross   x86/lguest: Remov...
121
  cgroup_clean hv_clean firewire_clean spi_clean usb_clean virtio_clean vm_clean net_clean iio_clean gpio_clean objtool_clean leds_clean:
85c66be10   Borislav Petkov   perf tools: Intro...
122
  	$(call descend,$(@:_clean=),clean)
0041898ec   S. Lockwood-Childs   tools/liblockdep:...
123
124
  liblockdep_clean:
  	$(call descend,lib/lockdep,clean)
379a9a28a   Jiri Olsa   tools build: No n...
125
  libapi_clean:
553873e1d   Borislav Petkov   tools/: Convert t...
126
  	$(call descend,lib/api,clean)
85c66be10   Borislav Petkov   perf tools: Intro...
127

2f5a7f1d1   Jiri Olsa   tools: Add clean ...
128
129
130
131
132
  libbpf_clean:
  	$(call descend,lib/bpf,clean)
  
  libsubcmd_clean:
  	$(call descend,lib/subcmd,clean)
379a9a28a   Jiri Olsa   tools build: No n...
133
  perf_clean:
ab362f5a9   Jiri Olsa   tools build: Fix ...
134
135
  	$(Q)mkdir -p $(PERF_O) .
  	$(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
2363ecb17   Borislav Petkov   tools: Add a topl...
136
137
  
  selftests_clean:
ca9dfc6cc   David Howells   tools: Define a M...
138
  	$(call descend,testing/$(@:_clean=),clean)
2363ecb17   Borislav Petkov   tools: Add a topl...
139
140
  
  turbostat_clean x86_energy_perf_policy_clean:
ca9dfc6cc   David Howells   tools: Define a M...
141
  	$(call descend,power/x86/$(@:_clean=),clean)
2363ecb17   Borislav Petkov   tools: Add a topl...
142

94f69966f   Jacob Pan   tools/thermal: In...
143
144
  tmon_clean:
  	$(call descend,thermal/tmon,clean)
b3fd7368f   Pali Rohár   Move freefall pro...
145
146
  freefall_clean:
  	$(call descend,laptop/freefall,clean)
2f5a7f1d1   Jiri Olsa   tools: Add clean ...
147
148
  build_clean:
  	$(call descend,build,clean)
ecda85e70   Juergen Gross   x86/lguest: Remov...
149
  clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean \
5eca4d843   Joshua Clayton   spi: Move spi cod...
150
  		perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
23908db41   Linus Torvalds   Merge tag 'stagin...
151
  		vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
6d591c46b   Linus Walleij   tools/gpio: creat...
152
  		freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
fa7f32422   David Lechner   tools/leds: Add u...
153
  		gpio_clean objtool_clean leds_clean
2363ecb17   Borislav Petkov   tools: Add a topl...
154
155
  
  .PHONY: FORCE