Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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 ' cgroup - cgroup tools'
  13. @echo ' cpupower - a tool for all things x86 CPU power'
  14. @echo ' debugging - tools for debugging'
  15. @echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
  16. @echo ' firmware - Firmware tools'
  17. @echo ' freefall - laptop accelerometer program for disk protection'
  18. @echo ' gpio - GPIO tools'
  19. @echo ' hv - tools used when in Hyper-V clients'
  20. @echo ' iio - IIO tools'
  21. @echo ' intel-speed-select - Intel Speed Select tool'
  22. @echo ' kvm_stat - top-like utility for displaying kvm statistics'
  23. @echo ' leds - LEDs tools'
  24. @echo ' liblockdep - user-space wrapper for kernel locking-validator'
  25. @echo ' objtool - an ELF object analysis tool'
  26. @echo ' pci - PCI tools'
  27. @echo ' perf - Linux performance measurement and analysis tool'
  28. @echo ' selftests - various kernel selftests'
  29. @echo ' bootconfig - boot config tool'
  30. @echo ' spi - spi tools'
  31. @echo ' tmon - thermal monitoring and tuning tool'
  32. @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
  33. @echo ' usb - USB testing tools'
  34. @echo ' virtio - vhost test module'
  35. @echo ' vm - misc vm tools'
  36. @echo ' wmi - WMI interface examples'
  37. @echo ' x86_energy_perf_policy - Intel energy policy tool'
  38. @echo ''
  39. @echo 'You can do:'
  40. @echo ' $$ make -C tools/ <tool>_install'
  41. @echo ''
  42. @echo ' from the kernel command line to build and install one of'
  43. @echo ' the tools above'
  44. @echo ''
  45. @echo ' $$ make tools/all'
  46. @echo ''
  47. @echo ' builds all tools.'
  48. @echo ''
  49. @echo ' $$ make tools/install'
  50. @echo ''
  51. @echo ' installs all tools.'
  52. @echo ''
  53. @echo 'Cleaning targets:'
  54. @echo ''
  55. @echo ' all of the above with the "_clean" string appended cleans'
  56. @echo ' the respective build directory.'
  57. @echo ' clean: a summary clean target to clean _all_ folders'
  58. acpi: FORCE
  59. $(call descend,power/$@)
  60. cpupower: FORCE
  61. $(call descend,power/$@)
  62. cgroup firewire hv guest bootconfig spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging: FORCE
  63. $(call descend,$@)
  64. bpf/%: FORCE
  65. $(call descend,$@)
  66. liblockdep: FORCE
  67. $(call descend,lib/lockdep)
  68. libapi: FORCE
  69. $(call descend,lib/api)
  70. # The perf build does not follow the descend function setup,
  71. # invoking it via it's own make rule.
  72. PERF_O = $(if $(O),$(O)/tools/perf,)
  73. perf: FORCE
  74. $(Q)mkdir -p $(PERF_O) .
  75. $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
  76. selftests: FORCE
  77. $(call descend,testing/$@)
  78. turbostat x86_energy_perf_policy intel-speed-select: FORCE
  79. $(call descend,power/x86/$@)
  80. tmon: FORCE
  81. $(call descend,thermal/$@)
  82. freefall: FORCE
  83. $(call descend,laptop/$@)
  84. kvm_stat: FORCE
  85. $(call descend,kvm/$@)
  86. all: acpi cgroup cpupower gpio hv firewire liblockdep \
  87. perf selftests bootconfig spi turbostat usb \
  88. virtio vm bpf x86_energy_perf_policy \
  89. tmon freefall iio objtool kvm_stat wmi \
  90. pci debugging
  91. acpi_install:
  92. $(call descend,power/$(@:_install=),install)
  93. cpupower_install:
  94. $(call descend,power/$(@:_install=),install)
  95. cgroup_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install vm_install bpf_install objtool_install wmi_install pci_install debugging_install:
  96. $(call descend,$(@:_install=),install)
  97. liblockdep_install:
  98. $(call descend,lib/lockdep,install)
  99. selftests_install:
  100. $(call descend,testing/$(@:_install=),install)
  101. turbostat_install x86_energy_perf_policy_install intel-speed-select_install:
  102. $(call descend,power/x86/$(@:_install=),install)
  103. tmon_install:
  104. $(call descend,thermal/$(@:_install=),install)
  105. freefall_install:
  106. $(call descend,laptop/$(@:_install=),install)
  107. kvm_stat_install:
  108. $(call descend,kvm/$(@:_install=),install)
  109. install: acpi_install cgroup_install cpupower_install gpio_install \
  110. hv_install firewire_install iio_install liblockdep_install \
  111. perf_install selftests_install turbostat_install usb_install \
  112. virtio_install vm_install bpf_install x86_energy_perf_policy_install \
  113. tmon_install freefall_install objtool_install kvm_stat_install \
  114. wmi_install pci_install debugging_install intel-speed-select_install
  115. acpi_clean:
  116. $(call descend,power/acpi,clean)
  117. cpupower_clean:
  118. $(call descend,power/cpupower,clean)
  119. cgroup_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean vm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean:
  120. $(call descend,$(@:_clean=),clean)
  121. liblockdep_clean:
  122. $(call descend,lib/lockdep,clean)
  123. libapi_clean:
  124. $(call descend,lib/api,clean)
  125. libbpf_clean:
  126. $(call descend,lib/bpf,clean)
  127. libsubcmd_clean:
  128. $(call descend,lib/subcmd,clean)
  129. perf_clean:
  130. $(Q)mkdir -p $(PERF_O) .
  131. $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
  132. selftests_clean:
  133. $(call descend,testing/$(@:_clean=),clean)
  134. turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean:
  135. $(call descend,power/x86/$(@:_clean=),clean)
  136. tmon_clean:
  137. $(call descend,thermal/tmon,clean)
  138. freefall_clean:
  139. $(call descend,laptop/freefall,clean)
  140. build_clean:
  141. $(call descend,build,clean)
  142. clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean \
  143. perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
  144. vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
  145. freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
  146. gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \
  147. intel-speed-select_clean
  148. .PHONY: FORCE