]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/testing/selftests/Makefile
selftests: add EXTRA_CLEAN for clean target
[mirror_ubuntu-bionic-kernel.git] / tools / testing / selftests / Makefile
CommitLineData
5aa5bd14
DB
1TARGETS = bpf
2TARGETS += breakpoints
f4ecb322 3TARGETS += capabilities
58c7be84
PE
4TARGETS += cpu-hotplug
5TARGETS += efivarfs
96e869d8
AM
6TARGETS += exec
7TARGETS += firmware
8TARGETS += ftrace
ecac1a75 9TARGETS += futex
22f6592b 10TARGETS += gpio
7e722473 11TARGETS += ipc
66a01b96 12TARGETS += kcmp
317dc34a 13TARGETS += lib
b6d97344 14TARGETS += membarrier
4f5ce5e8 15TARGETS += memfd
58c7be84 16TARGETS += memory-hotplug
db181ce0 17TARGETS += mount
96e869d8 18TARGETS += mqueue
a6f68034 19TARGETS += net
6ad92bf6 20TARGETS += nsfs
96e869d8 21TARGETS += powerpc
cc04a46f 22TARGETS += pstore
17afab1d 23TARGETS += ptrace
c99ee51a 24TARGETS += seccomp
19fd2868 25TARGETS += sigaltstack
96e869d8 26TARGETS += size
1087d019 27TARGETS += static_keys
82208160 28TARGETS += sync
96e869d8 29TARGETS += sysctl
2278e5ed 30ifneq (1, $(quicktest))
0bc4b0cf 31TARGETS += timers
2278e5ed 32endif
3e2a4c18 33TARGETS += user
96e869d8 34TARGETS += vm
3f705dfd 35TARGETS += x86
f21fb798 36TARGETS += zram
96e869d8 37#Please keep the TARGETS list alphabetically sorted
2278e5ed
SK
38# Run "make quicktest=1 run_tests" or
39# "make quicktest=1 kselftest from top level Makefile
274343ad 40
ddddda9b
SK
41TARGETS_HOTPLUG = cpu-hotplug
42TARGETS_HOTPLUG += memory-hotplug
43
67d8712d
SK
44# Clear LDFLAGS and MAKEFLAGS if called from main
45# Makefile to avoid test build failures when test
46# Makefile doesn't have explicit build rules.
47ifeq (1,$(MAKELEVEL))
60df4642 48override LDFLAGS =
67d8712d
SK
49override MAKEFLAGS =
50endif
51
274343ad
FW
52all:
53 for TARGET in $(TARGETS); do \
54 make -C $$TARGET; \
55 done;
56
cab6b056 57run_tests: all
f467f714
FW
58 for TARGET in $(TARGETS); do \
59 make -C $$TARGET run_tests; \
60 done;
61
ddddda9b
SK
62hotplug:
63 for TARGET in $(TARGETS_HOTPLUG); do \
64 make -C $$TARGET; \
65 done;
66
67run_hotplug: hotplug
68 for TARGET in $(TARGETS_HOTPLUG); do \
69 make -C $$TARGET run_full_test; \
70 done;
71
72clean_hotplug:
73 for TARGET in $(TARGETS_HOTPLUG); do \
74 make -C $$TARGET clean; \
75 done;
76
f615e2bb
HT
77run_pstore_crash:
78 make -C pstore run_crash
79
32dcfba6
ME
80INSTALL_PATH ?= install
81INSTALL_PATH := $(abspath $(INSTALL_PATH))
82ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
83
84install:
85ifdef INSTALL_PATH
86 @# Ask all targets to install their files
87 mkdir -p $(INSTALL_PATH)
88 for TARGET in $(TARGETS); do \
32dcfba6
ME
89 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
90 done;
91
92 @# Ask all targets to emit their test scripts
93 echo "#!/bin/bash" > $(ALL_SCRIPT)
94 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
95 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
96
97 for TARGET in $(TARGETS); do \
98 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
99 echo "echo ========================================" >> $(ALL_SCRIPT); \
100 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
101 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
102 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
103 done;
104
105 chmod u+x $(ALL_SCRIPT)
106else
107 $(error Error: set INSTALL_PATH to use install)
108endif
109
274343ad
FW
110clean:
111 for TARGET in $(TARGETS); do \
112 make -C $$TARGET clean; \
113 done;
32dcfba6
ME
114
115.PHONY: install