blob: 89b05e2222c913ff47e12673e9850616f585dbf9 [file] [log] [blame]
Andrew Morton66a01b92013-02-27 17:05:56 -08001TARGETS = breakpoints
Andrew Morton66a01b92013-02-27 17:05:56 -08002TARGETS += cpu-hotplug
Andrew Morton66a01b92013-02-27 17:05:56 -08003TARGETS += efivarfs
Andrew Morton96e869d2014-12-18 16:17:43 -08004TARGETS += exec
5TARGETS += firmware
6TARGETS += ftrace
Darren Hartecac1a72015-05-12 21:07:55 -07007TARGETS += futex
Pavel Emelyanov58c7be82013-04-30 15:27:06 -07008TARGETS += kcmp
Pranith Kumarb6d97342015-09-11 13:07:42 -07009TARGETS += membarrier
David Herrmann4f5ce5e2014-08-08 14:25:32 -070010TARGETS += memfd
Pavel Emelyanov58c7be82013-04-30 15:27:06 -070011TARGETS += memory-hotplug
Eric W. Biedermandb181ce2014-07-29 15:50:44 -070012TARGETS += mount
Andrew Morton96e869d2014-12-18 16:17:43 -080013TARGETS += mqueue
David S. Millera6f68032013-03-20 15:07:56 -040014TARGETS += net
Michael Ellerman0e56dac2013-08-06 17:42:35 +100015TARGETS += powerpc
Andrew Morton96e869d2014-12-18 16:17:43 -080016TARGETS += ptrace
Kees Cookc99ee512015-06-16 10:54:14 -070017TARGETS += seccomp
Tim Bird3ce51052014-12-03 10:42:21 -080018TARGETS += size
Andrew Morton96e869d2014-12-18 16:17:43 -080019TARGETS += sysctl
Shuah Khan2278e5e2015-06-19 13:13:43 -060020ifneq (1, $(quicktest))
Andrew Morton96e869d2014-12-18 16:17:43 -080021TARGETS += timers
Shuah Khan2278e5e2015-06-19 13:13:43 -060022endif
Andrew Morton96e869d2014-12-18 16:17:43 -080023TARGETS += user
Jason Baron579e1ac2015-07-30 03:59:44 +000024TARGETS += jumplabel
Andrew Morton96e869d2014-12-18 16:17:43 -080025TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070026TARGETS += x86
Naresh Kambojuf21fb792015-08-18 12:31:59 +053027TARGETS += zram
Andrew Morton96e869d2014-12-18 16:17:43 -080028#Please keep the TARGETS list alphabetically sorted
Shuah Khan2278e5e2015-06-19 13:13:43 -060029# Run "make quicktest=1 run_tests" or
30# "make quicktest=1 kselftest from top level Makefile
Frederic Weisbecker274343a2012-01-12 17:20:44 -080031
Shuah Khanddddda92014-07-02 09:51:38 -060032TARGETS_HOTPLUG = cpu-hotplug
33TARGETS_HOTPLUG += memory-hotplug
34
Shuah Khan67d87122015-03-18 11:57:39 -060035# Clear LDFLAGS and MAKEFLAGS if called from main
36# Makefile to avoid test build failures when test
37# Makefile doesn't have explicit build rules.
38ifeq (1,$(MAKELEVEL))
Arnaldo Carvalho de Melo60df4642015-05-14 16:55:18 -030039override LDFLAGS =
Shuah Khan67d87122015-03-18 11:57:39 -060040override MAKEFLAGS =
41endif
42
Frederic Weisbecker274343a2012-01-12 17:20:44 -080043all:
44 for TARGET in $(TARGETS); do \
45 make -C $$TARGET; \
46 done;
47
Andrew Mortoncab6b052012-03-28 14:42:54 -070048run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070049 for TARGET in $(TARGETS); do \
50 make -C $$TARGET run_tests; \
51 done;
52
Shuah Khanddddda92014-07-02 09:51:38 -060053hotplug:
54 for TARGET in $(TARGETS_HOTPLUG); do \
55 make -C $$TARGET; \
56 done;
57
58run_hotplug: hotplug
59 for TARGET in $(TARGETS_HOTPLUG); do \
60 make -C $$TARGET run_full_test; \
61 done;
62
63clean_hotplug:
64 for TARGET in $(TARGETS_HOTPLUG); do \
65 make -C $$TARGET clean; \
66 done;
67
Michael Ellerman32dcfba2015-03-11 15:06:00 +110068INSTALL_PATH ?= install
69INSTALL_PATH := $(abspath $(INSTALL_PATH))
70ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
71
72install:
73ifdef INSTALL_PATH
74 @# Ask all targets to install their files
75 mkdir -p $(INSTALL_PATH)
76 for TARGET in $(TARGETS); do \
Michael Ellerman32dcfba2015-03-11 15:06:00 +110077 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
78 done;
79
80 @# Ask all targets to emit their test scripts
81 echo "#!/bin/bash" > $(ALL_SCRIPT)
82 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
83 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
84
85 for TARGET in $(TARGETS); do \
86 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
87 echo "echo ========================================" >> $(ALL_SCRIPT); \
88 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
89 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
90 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
91 done;
92
93 chmod u+x $(ALL_SCRIPT)
94else
95 $(error Error: set INSTALL_PATH to use install)
96endif
97
Frederic Weisbecker274343a2012-01-12 17:20:44 -080098clean:
99 for TARGET in $(TARGETS); do \
100 make -C $$TARGET clean; \
101 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +1100102
103.PHONY: install