blob: ff9e5f20a5a73cedc5f03992066176279c38426e [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
Michael Ellerman0e56dac2013-08-06 17:42:35 +100018TARGETS += powerpc
Hiraku Toyookacc04a462015-10-02 20:46:39 +090019TARGETS += pstore
Andrew Morton96e869d2014-12-18 16:17:43 -080020TARGETS += ptrace
Kees Cookc99ee512015-06-16 10:54:14 -070021TARGETS += seccomp
Stas Sergeev19fd2862016-04-14 23:20:05 +030022TARGETS += sigaltstack
Tim Bird3ce51052014-12-03 10:42:21 -080023TARGETS += size
Bamvor Jian Zhang1087d012015-09-09 21:06:25 +080024TARGETS += static_keys
Andrew Morton96e869d2014-12-18 16:17:43 -080025TARGETS += sysctl
Shuah Khan2278e5e2015-06-19 13:13:43 -060026ifneq (1, $(quicktest))
Andrew Morton96e869d2014-12-18 16:17:43 -080027TARGETS += timers
Shuah Khan2278e5e2015-06-19 13:13:43 -060028endif
Andrew Morton96e869d2014-12-18 16:17:43 -080029TARGETS += user
30TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070031TARGETS += x86
Naresh Kambojuf21fb792015-08-18 12:31:59 +053032TARGETS += zram
Andrew Morton96e869d2014-12-18 16:17:43 -080033#Please keep the TARGETS list alphabetically sorted
Shuah Khan2278e5e2015-06-19 13:13:43 -060034# Run "make quicktest=1 run_tests" or
35# "make quicktest=1 kselftest from top level Makefile
Frederic Weisbecker274343a2012-01-12 17:20:44 -080036
Shuah Khanddddda92014-07-02 09:51:38 -060037TARGETS_HOTPLUG = cpu-hotplug
38TARGETS_HOTPLUG += memory-hotplug
39
Shuah Khan67d87122015-03-18 11:57:39 -060040# 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))
Arnaldo Carvalho de Melo60df4642015-05-14 16:55:18 -030044override LDFLAGS =
Shuah Khan67d87122015-03-18 11:57:39 -060045override MAKEFLAGS =
46endif
47
Frederic Weisbecker274343a2012-01-12 17:20:44 -080048all:
49 for TARGET in $(TARGETS); do \
50 make -C $$TARGET; \
51 done;
52
Andrew Mortoncab6b052012-03-28 14:42:54 -070053run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070054 for TARGET in $(TARGETS); do \
55 make -C $$TARGET run_tests; \
56 done;
57
Shuah Khanddddda92014-07-02 09:51:38 -060058hotplug:
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
Hiraku Toyookaf615e2b2015-10-02 20:46:41 +090073run_pstore_crash:
74 make -C pstore run_crash
75
Michael Ellerman32dcfba2015-03-11 15:06:00 +110076INSTALL_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 \
Michael Ellerman32dcfba2015-03-11 15:06:00 +110085 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
Frederic Weisbecker274343a2012-01-12 17:20:44 -0800106clean:
107 for TARGET in $(TARGETS); do \
108 make -C $$TARGET clean; \
109 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +1100110
111.PHONY: install