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