Makefile 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Some of the tools (perf) use same make variables
  3. # as in kernel build.
  4. export srctree=
  5. export objtree=
  6. include scripts/Makefile.include
  7. help:
  8. @echo 'Possible targets:'
  9. @echo ''
  10. @echo ' acpi - ACPI tools'
  11. @echo ' bpf - misc BPF tools'
  12. @echo ' counter - counter tools'
  13. @echo ' cpupower - a tool for all things x86 CPU power'
  14. @echo ' debugging - tools for debugging'
  15. @echo ' dma - tools for DMA mapping'
  16. @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
  17. @echo ' firmware - Firmware tools'
  18. @echo ' freefall - laptop accelerometer program for disk protection'
  19. @echo ' gpio - GPIO tools'
  20. @echo ' hv - tools used when in Hyper-V clients'
  21. @echo ' iio - IIO tools'
  22. @echo ' intel-speed-select - Intel Speed Select tool'
  23. @echo ' kvm_stat - top-like utility for displaying kvm statistics'
  24. @echo ' leds - LEDs tools'
  25. @echo ' nolibc - nolibc headers testing and installation'
  26. @echo ' objtool - an ELF object analysis tool'
  27. @echo ' perf - Linux performance measurement and analysis tool'
  28. @echo ' selftests - various kernel selftests'
  29. @echo ' sched_ext - sched_ext example schedulers'
  30. @echo ' bootconfig - boot config tool'
  31. @echo ' spi - spi tools'
  32. @echo ' tmon - thermal monitoring and tuning tool'
  33. @echo ' thermometer - temperature capture tool'
  34. @echo ' thermal-engine - thermal monitoring tool'
  35. @echo ' thermal - thermal library'
  36. @echo ' tracing - misc tracing tools'
  37. @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
  38. @echo ' usb - USB testing tools'
  39. @echo ' virtio - vhost test module'
  40. @echo ' mm - misc mm tools'
  41. @echo ' wmi - WMI interface examples'
  42. @echo ' x86_energy_perf_policy - Intel energy policy tool'
  43. @echo ' ynl - ynl headers, library, and python tool'
  44. @echo ''
  45. @echo 'You can do:'
  46. @echo ' $$ make -C tools/ <tool>_install'
  47. @echo ''
  48. @echo ' from the kernel command line to build and install one of'
  49. @echo ' the tools above'
  50. @echo ''
  51. @echo ' $$ make tools/all'
  52. @echo ''
  53. @echo ' builds all tools.'
  54. @echo ''
  55. @echo ' $$ make tools/install'
  56. @echo ''
  57. @echo ' installs all tools.'
  58. @echo ''
  59. @echo 'Cleaning targets:'
  60. @echo ''
  61. @echo ' all of the above with the "_clean" string appended cleans'
  62. @echo ' the respective build directory.'
  63. @echo ' clean: a summary clean target to clean _all_ folders'
  64. acpi: FORCE
  65. $(call descend,power/$@)
  66. cpupower: FORCE
  67. $(call descend,power/$@)
  68. counter dma firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtool leds wmi firmware debugging tracing: FORCE
  69. $(call descend,$@)
  70. bpf/%: FORCE
  71. $(call descend,$@)
  72. libapi: FORCE
  73. $(call descend,lib/api)
  74. nolibc: FORCE
  75. $(call descend,include/nolibc)
  76. nolibc_%: FORCE
  77. $(call descend,include/nolibc,$(patsubst nolibc_%,%,$@))
  78. # The perf build does not follow the descend function setup,
  79. # invoking it via it's own make rule.
  80. PERF_O = $(if $(O),$(O)/tools/perf,)
  81. perf: FORCE
  82. $(Q)mkdir -p $(PERF_O) .
  83. $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
  84. sched_ext: FORCE
  85. $(call descend,sched_ext)
  86. selftests: FORCE
  87. $(call descend,testing/$@)
  88. thermal: FORCE
  89. $(call descend,lib/$@)
  90. turbostat x86_energy_perf_policy intel-speed-select: FORCE
  91. $(call descend,power/x86/$@)
  92. tmon: FORCE
  93. $(call descend,thermal/$@)
  94. thermometer: FORCE
  95. $(call descend,thermal/$@)
  96. thermal-engine: FORCE thermal
  97. $(call descend,thermal/$@)
  98. freefall: FORCE
  99. $(call descend,laptop/$@)
  100. kvm_stat: FORCE
  101. $(call descend,kvm/$@)
  102. ynl: FORCE
  103. $(call descend,net/ynl)
  104. all: acpi counter cpupower dma gpio hv firewire \
  105. perf selftests bootconfig spi turbostat usb \
  106. virtio mm bpf x86_energy_perf_policy \
  107. tmon freefall iio objtool kvm_stat wmi \
  108. debugging tracing thermal thermometer thermal-engine ynl
  109. acpi_install:
  110. $(call descend,power/$(@:_install=),install)
  111. cpupower_install:
  112. $(call descend,power/$(@:_install=),install)
  113. counter_install dma_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install mm_install bpf_install objtool_install wmi_install debugging_install tracing_install:
  114. $(call descend,$(@:_install=),install)
  115. selftests_install:
  116. $(call descend,testing/$(@:_install=),install)
  117. thermal_install:
  118. $(call descend,lib/$(@:_install=),install)
  119. turbostat_install x86_energy_perf_policy_install intel-speed-select_install:
  120. $(call descend,power/x86/$(@:_install=),install)
  121. tmon_install:
  122. $(call descend,thermal/$(@:_install=),install)
  123. thermometer_install:
  124. $(call descend,thermal/$(@:_install=),install)
  125. thermal-engine_install:
  126. $(call descend,thermal/$(@:_install=),install)
  127. freefall_install:
  128. $(call descend,laptop/$(@:_install=),install)
  129. kvm_stat_install:
  130. $(call descend,kvm/$(@:_install=),install)
  131. ynl_install:
  132. $(call descend,net/$(@:_install=),install)
  133. install: acpi_install counter_install cpupower_install dma_install gpio_install \
  134. hv_install firewire_install iio_install \
  135. perf_install selftests_install turbostat_install usb_install \
  136. virtio_install mm_install bpf_install x86_energy_perf_policy_install \
  137. tmon_install freefall_install objtool_install kvm_stat_install \
  138. wmi_install debugging_install intel-speed-select_install \
  139. tracing_install thermometer_install thermal-engine_install ynl_install
  140. acpi_clean:
  141. $(call descend,power/acpi,clean)
  142. cpupower_clean:
  143. $(call descend,power/cpupower,clean)
  144. counter_clean dma_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean firmware_clean debugging_clean tracing_clean:
  145. $(call descend,$(@:_clean=),clean)
  146. libapi_clean:
  147. $(call descend,lib/api,clean)
  148. libbpf_clean:
  149. $(call descend,lib/bpf,clean)
  150. libsubcmd_clean:
  151. $(call descend,lib/subcmd,clean)
  152. perf_clean:
  153. $(Q)mkdir -p $(PERF_O) .
  154. $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
  155. sched_ext_clean:
  156. $(call descend,sched_ext,clean)
  157. selftests_clean:
  158. $(call descend,testing/$(@:_clean=),clean)
  159. thermal_clean:
  160. $(call descend,lib/thermal,clean)
  161. turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean:
  162. $(call descend,power/x86/$(@:_clean=),clean)
  163. thermometer_clean:
  164. $(call descend,thermal/thermometer,clean)
  165. thermal-engine_clean:
  166. $(call descend,thermal/thermal-engine,clean)
  167. tmon_clean:
  168. $(call descend,thermal/tmon,clean)
  169. freefall_clean:
  170. $(call descend,laptop/freefall,clean)
  171. build_clean:
  172. $(call descend,build,clean)
  173. ynl_clean:
  174. $(call descend,net/$(@:_clean=),clean)
  175. clean: acpi_clean counter_clean cpupower_clean dma_clean hv_clean firewire_clean \
  176. perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
  177. mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
  178. freefall_clean build_clean libbpf_clean libsubcmd_clean \
  179. gpio_clean objtool_clean leds_clean wmi_clean firmware_clean debugging_clean \
  180. intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean \
  181. sched_ext_clean ynl_clean
  182. .PHONY: FORCE