Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 ' hv - tools used when in Hyper-V clients'
  14. @echo ' iio - IIO tools'
  15. @echo ' lguest - a minimal 32-bit x86 hypervisor'
  16. @echo ' perf - Linux performance measurement and analysis tool'
  17. @echo ' selftests - various kernel selftests'
  18. @echo ' turbostat - Intel CPU idle stats and freq reporting tool'
  19. @echo ' usb - USB testing tools'
  20. @echo ' virtio - vhost test module'
  21. @echo ' net - misc networking tools'
  22. @echo ' vm - misc vm tools'
  23. @echo ' x86_energy_perf_policy - Intel energy policy tool'
  24. @echo ' tmon - thermal monitoring and tuning tool'
  25. @echo ' freefall - laptop accelerometer program for disk protection'
  26. @echo ''
  27. @echo 'You can do:'
  28. @echo ' $$ make -C tools/ <tool>_install'
  29. @echo ''
  30. @echo ' from the kernel command line to build and install one of'
  31. @echo ' the tools above'
  32. @echo ''
  33. @echo ' $$ make tools/all'
  34. @echo ''
  35. @echo ' builds all tools.'
  36. @echo ''
  37. @echo ' $$ make tools/install'
  38. @echo ''
  39. @echo ' installs all tools.'
  40. @echo ''
  41. @echo 'Cleaning targets:'
  42. @echo ''
  43. @echo ' all of the above with the "_clean" string appended cleans'
  44. @echo ' the respective build directory.'
  45. @echo ' clean: a summary clean target to clean _all_ folders'
  46. acpi: FORCE
  47. $(call descend,power/$@)
  48. cpupower: FORCE
  49. $(call descend,power/$@)
  50. cgroup firewire hv guest usb virtio vm net iio: FORCE
  51. $(call descend,$@)
  52. liblockdep: FORCE
  53. $(call descend,lib/lockdep)
  54. libapi: FORCE
  55. $(call descend,lib/api)
  56. # The perf build does not follow the descend function setup,
  57. # invoking it via it's own make rule.
  58. PERF_O = $(if $(O),$(O)/tools/perf,)
  59. perf: FORCE
  60. $(Q)mkdir -p $(PERF_O) .
  61. $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
  62. selftests: FORCE
  63. $(call descend,testing/$@)
  64. turbostat x86_energy_perf_policy: FORCE
  65. $(call descend,power/x86/$@)
  66. tmon: FORCE
  67. $(call descend,thermal/$@)
  68. freefall: FORCE
  69. $(call descend,laptop/$@)
  70. all: acpi cgroup cpupower hv firewire lguest \
  71. perf selftests turbostat usb \
  72. virtio vm net x86_energy_perf_policy \
  73. tmon freefall
  74. acpi_install:
  75. $(call descend,power/$(@:_install=),install)
  76. cpupower_install:
  77. $(call descend,power/$(@:_install=),install)
  78. cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install:
  79. $(call descend,$(@:_install=),install)
  80. selftests_install:
  81. $(call descend,testing/$(@:_clean=),install)
  82. turbostat_install x86_energy_perf_policy_install:
  83. $(call descend,power/x86/$(@:_install=),install)
  84. tmon_install:
  85. $(call descend,thermal/$(@:_install=),install)
  86. freefall_install:
  87. $(call descend,laptop/$(@:_install=),install)
  88. install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
  89. perf_install selftests_install turbostat_install usb_install \
  90. virtio_install vm_install net_install x86_energy_perf_policy_install \
  91. tmon_install freefall_install
  92. acpi_clean:
  93. $(call descend,power/acpi,clean)
  94. cpupower_clean:
  95. $(call descend,power/cpupower,clean)
  96. cgroup_clean hv_clean firewire_clean lguest_clean usb_clean virtio_clean vm_clean net_clean iio_clean:
  97. $(call descend,$(@:_clean=),clean)
  98. liblockdep_clean:
  99. $(call descend,lib/lockdep,clean)
  100. libapi_clean:
  101. $(call descend,lib/api,clean)
  102. perf_clean:
  103. $(call descend,$(@:_clean=),clean)
  104. selftests_clean:
  105. $(call descend,testing/$(@:_clean=),clean)
  106. turbostat_clean x86_energy_perf_policy_clean:
  107. $(call descend,power/x86/$(@:_clean=),clean)
  108. tmon_clean:
  109. $(call descend,thermal/tmon,clean)
  110. freefall_clean:
  111. $(call descend,laptop/freefall,clean)
  112. clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean lguest_clean \
  113. perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
  114. vm_clean net_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
  115. freefall_clean
  116. .PHONY: FORCE