Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 # Some of the tools (perf) use same make variables
0003 # as in kernel build.
0004 export srctree=
0005 export objtree=
0006 
0007 include scripts/Makefile.include
0008 
0009 help:
0010         @echo 'Possible targets:'
0011         @echo ''
0012         @echo '  acpi                   - ACPI tools'
0013         @echo '  bpf                    - misc BPF tools'
0014         @echo '  cgroup                 - cgroup tools'
0015         @echo '  counter                - counter tools'
0016         @echo '  cpupower               - a tool for all things x86 CPU power'
0017         @echo '  debugging              - tools for debugging'
0018         @echo '  firewire               - the userspace part of nosy, an IEEE-1394 traffic sniffer'
0019         @echo '  firmware               - Firmware tools'
0020         @echo '  freefall               - laptop accelerometer program for disk protection'
0021         @echo '  gpio                   - GPIO tools'
0022         @echo '  hv                     - tools used when in Hyper-V clients'
0023         @echo '  iio                    - IIO tools'
0024         @echo '  intel-speed-select     - Intel Speed Select tool'
0025         @echo '  kvm_stat               - top-like utility for displaying kvm statistics'
0026         @echo '  leds                   - LEDs  tools'
0027         @echo '  nolibc                 - nolibc headers testing and installation'
0028         @echo '  objtool                - an ELF object analysis tool'
0029         @echo '  pci                    - PCI tools'
0030         @echo '  perf                   - Linux performance measurement and analysis tool'
0031         @echo '  selftests              - various kernel selftests'
0032         @echo '  bootconfig             - boot config tool'
0033         @echo '  spi                    - spi tools'
0034         @echo '  tmon                   - thermal monitoring and tuning tool'
0035         @echo '  thermometer            - temperature capture tool'
0036         @echo '  thermal-engine         - thermal monitoring tool'
0037         @echo '  thermal                - thermal library'
0038         @echo '  tracing                - misc tracing tools'
0039         @echo '  turbostat              - Intel CPU idle stats and freq reporting tool'
0040         @echo '  usb                    - USB testing tools'
0041         @echo '  virtio                 - vhost test module'
0042         @echo '  vm                     - misc vm tools'
0043         @echo '  wmi                    - WMI interface examples'
0044         @echo '  x86_energy_perf_policy - Intel energy policy tool'
0045         @echo ''
0046         @echo 'You can do:'
0047         @echo ' $$ make -C tools/ <tool>_install'
0048         @echo ''
0049         @echo '  from the kernel command line to build and install one of'
0050         @echo '  the tools above'
0051         @echo ''
0052         @echo '  $$ make tools/all'
0053         @echo ''
0054         @echo '  builds all tools.'
0055         @echo ''
0056         @echo '  $$ make tools/install'
0057         @echo ''
0058         @echo '  installs all tools.'
0059         @echo ''
0060         @echo 'Cleaning targets:'
0061         @echo ''
0062         @echo '  all of the above with the "_clean" string appended cleans'
0063         @echo '    the respective build directory.'
0064         @echo '  clean: a summary clean target to clean _all_ folders'
0065 
0066 acpi: FORCE
0067         $(call descend,power/$@)
0068 
0069 cpupower: FORCE
0070         $(call descend,power/$@)
0071 
0072 cgroup counter firewire hv guest bootconfig spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE
0073         $(call descend,$@)
0074 
0075 bpf/%: FORCE
0076         $(call descend,$@)
0077 
0078 libapi: FORCE
0079         $(call descend,lib/api)
0080 
0081 nolibc: FORCE
0082         $(call descend,include/nolibc)
0083 
0084 nolibc_%: FORCE
0085         $(call descend,include/nolibc,$(patsubst nolibc_%,%,$@))
0086 
0087 # The perf build does not follow the descend function setup,
0088 # invoking it via it's own make rule.
0089 PERF_O   = $(if $(O),$(O)/tools/perf,)
0090 
0091 perf: FORCE
0092         $(Q)mkdir -p $(PERF_O) .
0093         $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
0094 
0095 selftests: FORCE
0096         $(call descend,testing/$@)
0097 
0098 thermal: FORCE
0099         $(call descend,lib/$@)
0100 
0101 turbostat x86_energy_perf_policy intel-speed-select: FORCE
0102         $(call descend,power/x86/$@)
0103 
0104 tmon: FORCE
0105         $(call descend,thermal/$@)
0106 
0107 thermometer: FORCE
0108         $(call descend,thermal/$@)
0109 
0110 thermal-engine: FORCE thermal
0111         $(call descend,thermal/$@)
0112 
0113 freefall: FORCE
0114         $(call descend,laptop/$@)
0115 
0116 kvm_stat: FORCE
0117         $(call descend,kvm/$@)
0118 
0119 all: acpi cgroup counter cpupower gpio hv firewire \
0120                 perf selftests bootconfig spi turbostat usb \
0121                 virtio vm bpf x86_energy_perf_policy \
0122                 tmon freefall iio objtool kvm_stat wmi \
0123                 pci debugging tracing thermal thermometer thermal-engine
0124 
0125 acpi_install:
0126         $(call descend,power/$(@:_install=),install)
0127 
0128 cpupower_install:
0129         $(call descend,power/$(@:_install=),install)
0130 
0131 cgroup_install counter_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 tracing_install:
0132         $(call descend,$(@:_install=),install)
0133 
0134 selftests_install:
0135         $(call descend,testing/$(@:_install=),install)
0136 
0137 thermal_install:
0138         $(call descend,lib/$(@:_install=),install)
0139 
0140 turbostat_install x86_energy_perf_policy_install intel-speed-select_install:
0141         $(call descend,power/x86/$(@:_install=),install)
0142 
0143 tmon_install:
0144         $(call descend,thermal/$(@:_install=),install)
0145 
0146 thermometer_install:
0147         $(call descend,thermal/$(@:_install=),install)
0148 
0149 thermal-engine_install:
0150         $(call descend,thermal/$(@:_install=),install)
0151 
0152 freefall_install:
0153         $(call descend,laptop/$(@:_install=),install)
0154 
0155 kvm_stat_install:
0156         $(call descend,kvm/$(@:_install=),install)
0157 
0158 install: acpi_install cgroup_install counter_install cpupower_install gpio_install \
0159                 hv_install firewire_install iio_install \
0160                 perf_install selftests_install turbostat_install usb_install \
0161                 virtio_install vm_install bpf_install x86_energy_perf_policy_install \
0162                 tmon_install freefall_install objtool_install kvm_stat_install \
0163                 wmi_install pci_install debugging_install intel-speed-select_install \
0164                 tracing_install thermometer_install thermal-engine_install
0165 
0166 acpi_clean:
0167         $(call descend,power/acpi,clean)
0168 
0169 cpupower_clean:
0170         $(call descend,power/cpupower,clean)
0171 
0172 cgroup_clean counter_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 tracing_clean:
0173         $(call descend,$(@:_clean=),clean)
0174 
0175 libapi_clean:
0176         $(call descend,lib/api,clean)
0177 
0178 libbpf_clean:
0179         $(call descend,lib/bpf,clean)
0180 
0181 libsubcmd_clean:
0182         $(call descend,lib/subcmd,clean)
0183 
0184 perf_clean:
0185         $(Q)mkdir -p $(PERF_O) .
0186         $(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
0187 
0188 selftests_clean:
0189         $(call descend,testing/$(@:_clean=),clean)
0190 
0191 thermal_clean:
0192         $(call descend,lib/thermal,clean)
0193 
0194 turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean:
0195         $(call descend,power/x86/$(@:_clean=),clean)
0196 
0197 thermometer_clean:
0198         $(call descend,thermal/thermometer,clean)
0199 
0200 thermal-engine_clean:
0201         $(call descend,thermal/thermal-engine,clean)
0202 
0203 tmon_clean:
0204         $(call descend,thermal/tmon,clean)
0205 
0206 freefall_clean:
0207         $(call descend,laptop/freefall,clean)
0208 
0209 build_clean:
0210         $(call descend,build,clean)
0211 
0212 clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \
0213                 perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
0214                 vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
0215                 freefall_clean build_clean libbpf_clean libsubcmd_clean \
0216                 gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \
0217                 intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean
0218 
0219 .PHONY: FORCE