blob: 69cf1a68e4d32e8c69b41c4d9de10427d3704cd1 [file] [log] [blame]
Andrew Morton66a01b92013-02-27 17:05:56 -08001TARGETS = breakpoints
Bamvor Jian Zhangf4ecb322015-11-17 22:35:42 +08002TARGETS += capabilities
Andrew Morton66a01b92013-02-27 17:05:56 -08003TARGETS += cpu-hotplug
Andrew Morton66a01b92013-02-27 17:05:56 -08004TARGETS += efivarfs
Andrew Morton96e869d2014-12-18 16:17:43 -08005TARGETS += exec
6TARGETS += firmware
7TARGETS += ftrace
Darren Hartecac1a72015-05-12 21:07:55 -07008TARGETS += futex
Bamvor Jian Zhang7e722472015-11-17 22:35:43 +08009TARGETS += ipc
Pavel Emelyanov58c7be82013-04-30 15:27:06 -070010TARGETS += kcmp
Kees Cook317dc342015-11-06 16:30:32 -080011TARGETS += lib
Pranith Kumarb6d97342015-09-11 13:07:42 -070012TARGETS += membarrier
David Herrmann4f5ce5e2014-08-08 14:25:32 -070013TARGETS += memfd
Pavel Emelyanov58c7be82013-04-30 15:27:06 -070014TARGETS += memory-hotplug
Eric W. Biedermandb181ce2014-07-29 15:50:44 -070015TARGETS += mount
Andrew Morton96e869d2014-12-18 16:17:43 -080016TARGETS += mqueue
David S. Millera6f68032013-03-20 15:07:56 -040017TARGETS += net
Andrey Vagin6ad92bf2016-09-06 00:47:16 -070018TARGETS += nsfs
Michael Ellerman0e56dac2013-08-06 17:42:35 +100019TARGETS += powerpc
Hiraku Toyookacc04a462015-10-02 20:46:39 +090020TARGETS += pstore
Andrew Morton96e869d2014-12-18 16:17:43 -080021TARGETS += ptrace
Kees Cookc99ee512015-06-16 10:54:14 -070022TARGETS += seccomp
Stas Sergeev19fd2862016-04-14 23:20:05 +030023TARGETS += sigaltstack
Tim Bird3ce51052014-12-03 10:42:21 -080024TARGETS += size
Bamvor Jian Zhang1087d012015-09-09 21:06:25 +080025TARGETS += static_keys
Emilio López822081602016-10-19 09:49:48 -030026TARGETS += sync
Andrew Morton96e869d2014-12-18 16:17:43 -080027TARGETS += sysctl
Shuah Khan2278e5e2015-06-19 13:13:43 -060028ifneq (1, $(quicktest))
Andrew Morton96e869d2014-12-18 16:17:43 -080029TARGETS += timers
Shuah Khan2278e5e2015-06-19 13:13:43 -060030endif
Andrew Morton96e869d2014-12-18 16:17:43 -080031TARGETS += user
32TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070033TARGETS += x86
Naresh Kambojuf21fb792015-08-18 12:31:59 +053034TARGETS += zram
Andrew Morton96e869d2014-12-18 16:17:43 -080035#Please keep the TARGETS list alphabetically sorted
Shuah Khan2278e5e2015-06-19 13:13:43 -060036# Run "make quicktest=1 run_tests" or
37# "make quicktest=1 kselftest from top level Makefile
Frederic Weisbecker274343a2012-01-12 17:20:44 -080038
Shuah Khanddddda92014-07-02 09:51:38 -060039TARGETS_HOTPLUG = cpu-hotplug
40TARGETS_HOTPLUG += memory-hotplug
41
Shuah Khan67d87122015-03-18 11:57:39 -060042# Clear LDFLAGS and MAKEFLAGS if called from main
43# Makefile to avoid test build failures when test
44# Makefile doesn't have explicit build rules.
45ifeq (1,$(MAKELEVEL))
Arnaldo Carvalho de Melo60df4642015-05-14 16:55:18 -030046override LDFLAGS =
Shuah Khan67d87122015-03-18 11:57:39 -060047override MAKEFLAGS =
48endif
49
Frederic Weisbecker274343a2012-01-12 17:20:44 -080050all:
51 for TARGET in $(TARGETS); do \
52 make -C $$TARGET; \
53 done;
54
Andrew Mortoncab6b052012-03-28 14:42:54 -070055run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070056 for TARGET in $(TARGETS); do \
57 make -C $$TARGET run_tests; \
58 done;
59
Shuah Khanddddda92014-07-02 09:51:38 -060060hotplug:
61 for TARGET in $(TARGETS_HOTPLUG); do \
62 make -C $$TARGET; \
63 done;
64
65run_hotplug: hotplug
66 for TARGET in $(TARGETS_HOTPLUG); do \
67 make -C $$TARGET run_full_test; \
68 done;
69
70clean_hotplug:
71 for TARGET in $(TARGETS_HOTPLUG); do \
72 make -C $$TARGET clean; \
73 done;
74
Hiraku Toyookaf615e2b2015-10-02 20:46:41 +090075run_pstore_crash:
76 make -C pstore run_crash
77
Michael Ellerman32dcfba2015-03-11 15:06:00 +110078INSTALL_PATH ?= install
79INSTALL_PATH := $(abspath $(INSTALL_PATH))
80ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
81
82install:
83ifdef INSTALL_PATH
84 @# Ask all targets to install their files
85 mkdir -p $(INSTALL_PATH)
86 for TARGET in $(TARGETS); do \
Michael Ellerman32dcfba2015-03-11 15:06:00 +110087 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
88 done;
89
90 @# Ask all targets to emit their test scripts
91 echo "#!/bin/bash" > $(ALL_SCRIPT)
92 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
93 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
94
95 for TARGET in $(TARGETS); do \
96 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
97 echo "echo ========================================" >> $(ALL_SCRIPT); \
98 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
99 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
100 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
101 done;
102
103 chmod u+x $(ALL_SCRIPT)
104else
105 $(error Error: set INSTALL_PATH to use install)
106endif
107
Frederic Weisbecker274343a2012-01-12 17:20:44 -0800108clean:
109 for TARGET in $(TARGETS); do \
110 make -C $$TARGET clean; \
111 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +1100112
113.PHONY: install