Makefile 5.3 KB

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