Makefile 5.5 KB

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