Makefile 5.1 KB

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