~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/Makefile

Version: ~ [ linux-6.4-rc3 ] ~ [ linux-6.3.4 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.30 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.113 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.180 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.243 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.283 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.315 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 TARGETS =  bpf
  2 TARGETS += breakpoints
  3 TARGETS += capabilities
  4 TARGETS += cpufreq
  5 TARGETS += cpu-hotplug
  6 TARGETS += efivarfs
  7 TARGETS += exec
  8 TARGETS += firmware
  9 TARGETS += ftrace
 10 TARGETS += futex
 11 TARGETS += gpio
 12 TARGETS += intel_pstate
 13 TARGETS += ipc
 14 TARGETS += kcmp
 15 TARGETS += lib
 16 TARGETS += membarrier
 17 TARGETS += memfd
 18 TARGETS += memory-hotplug
 19 TARGETS += mount
 20 TARGETS += mqueue
 21 TARGETS += net
 22 TARGETS += nsfs
 23 TARGETS += powerpc
 24 TARGETS += pstore
 25 TARGETS += ptrace
 26 TARGETS += seccomp
 27 TARGETS += sigaltstack
 28 TARGETS += size
 29 TARGETS += splice
 30 TARGETS += static_keys
 31 TARGETS += sync
 32 TARGETS += sysctl
 33 ifneq (1, $(quicktest))
 34 TARGETS += timers
 35 endif
 36 TARGETS += user
 37 TARGETS += vm
 38 TARGETS += x86
 39 TARGETS += zram
 40 #Please keep the TARGETS list alphabetically sorted
 41 # Run "make quicktest=1 run_tests" or
 42 # "make quicktest=1 kselftest" from top level Makefile
 43 
 44 TARGETS_HOTPLUG = cpu-hotplug
 45 TARGETS_HOTPLUG += memory-hotplug
 46 
 47 # Clear LDFLAGS and MAKEFLAGS if called from main
 48 # Makefile to avoid test build failures when test
 49 # Makefile doesn't have explicit build rules.
 50 ifeq (1,$(MAKELEVEL))
 51 override LDFLAGS =
 52 override MAKEFLAGS =
 53 endif
 54 
 55 BUILD := $(O)
 56 ifndef BUILD
 57   BUILD := $(KBUILD_OUTPUT)
 58 endif
 59 ifndef BUILD
 60   BUILD := $(shell pwd)
 61 endif
 62 
 63 export BUILD
 64 all:
 65         for TARGET in $(TARGETS); do            \
 66                 BUILD_TARGET=$$BUILD/$$TARGET;  \
 67                 mkdir $$BUILD_TARGET  -p;       \
 68                 make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
 69         done;
 70 
 71 run_tests: all
 72         for TARGET in $(TARGETS); do \
 73                 BUILD_TARGET=$$BUILD/$$TARGET;  \
 74                 make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
 75         done;
 76 
 77 hotplug:
 78         for TARGET in $(TARGETS_HOTPLUG); do \
 79                 BUILD_TARGET=$$BUILD/$$TARGET;  \
 80                 make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
 81         done;
 82 
 83 run_hotplug: hotplug
 84         for TARGET in $(TARGETS_HOTPLUG); do \
 85                 BUILD_TARGET=$$BUILD/$$TARGET;  \
 86                 make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\
 87         done;
 88 
 89 clean_hotplug:
 90         for TARGET in $(TARGETS_HOTPLUG); do \
 91                 BUILD_TARGET=$$BUILD/$$TARGET;  \
 92                 make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
 93         done;
 94 
 95 run_pstore_crash:
 96         make -C pstore run_crash
 97 
 98 INSTALL_PATH ?= install
 99 INSTALL_PATH := $(abspath $(INSTALL_PATH))
100 ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
101 
102 install:
103 ifdef INSTALL_PATH
104         @# Ask all targets to install their files
105         mkdir -p $(INSTALL_PATH)
106         for TARGET in $(TARGETS); do \
107                 BUILD_TARGET=$$BUILD/$$TARGET;  \
108                 make OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
109         done;
110 
111         @# Ask all targets to emit their test scripts
112         echo "#!/bin/sh" > $(ALL_SCRIPT)
113         echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
114         echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
115 
116         for TARGET in $(TARGETS); do \
117                 BUILD_TARGET=$$BUILD/$$TARGET;  \
118                 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
119                 echo "echo ========================================" >> $(ALL_SCRIPT); \
120                 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
121                 make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
122                 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
123         done;
124 
125         chmod u+x $(ALL_SCRIPT)
126 else
127         $(error Error: set INSTALL_PATH to use install)
128 endif
129 
130 clean:
131         for TARGET in $(TARGETS); do \
132                 BUILD_TARGET=$$BUILD/$$TARGET;  \
133                 make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
134         done;
135 
136 .PHONY: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp