blob: 7474b7d9f4be8be791712458bd2a0f4eab8467a3 [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
David Herrmann4f5ce5e2014-08-08 14:25:32 -07009TARGETS += memfd
Pavel Emelyanov58c7be82013-04-30 15:27:06 -070010TARGETS += memory-hotplug
Eric W. Biedermandb181ce2014-07-29 15:50:44 -070011TARGETS += mount
Andrew Morton96e869d2014-12-18 16:17:43 -080012TARGETS += mqueue
David S. Millera6f68032013-03-20 15:07:56 -040013TARGETS += net
Michael Ellerman0e56dac2013-08-06 17:42:35 +100014TARGETS += powerpc
Andrew Morton96e869d2014-12-18 16:17:43 -080015TARGETS += ptrace
Kees Cookc99ee512015-06-16 10:54:14 -070016TARGETS += seccomp
Tim Bird3ce51052014-12-03 10:42:21 -080017TARGETS += size
Andrew Morton96e869d2014-12-18 16:17:43 -080018TARGETS += sysctl
19TARGETS += timers
20TARGETS += user
21TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070022TARGETS += x86
Andrew Morton96e869d2014-12-18 16:17:43 -080023#Please keep the TARGETS list alphabetically sorted
Frederic Weisbecker274343a2012-01-12 17:20:44 -080024
Shuah Khanddddda92014-07-02 09:51:38 -060025TARGETS_HOTPLUG = cpu-hotplug
26TARGETS_HOTPLUG += memory-hotplug
27
Shuah Khan67d87122015-03-18 11:57:39 -060028# Clear LDFLAGS and MAKEFLAGS if called from main
29# Makefile to avoid test build failures when test
30# Makefile doesn't have explicit build rules.
31ifeq (1,$(MAKELEVEL))
Arnaldo Carvalho de Melo60df4642015-05-14 16:55:18 -030032override LDFLAGS =
Shuah Khan67d87122015-03-18 11:57:39 -060033override MAKEFLAGS =
34endif
35
Frederic Weisbecker274343a2012-01-12 17:20:44 -080036all:
37 for TARGET in $(TARGETS); do \
38 make -C $$TARGET; \
39 done;
40
Andrew Mortoncab6b052012-03-28 14:42:54 -070041run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070042 for TARGET in $(TARGETS); do \
43 make -C $$TARGET run_tests; \
44 done;
45
Shuah Khanddddda92014-07-02 09:51:38 -060046hotplug:
47 for TARGET in $(TARGETS_HOTPLUG); do \
48 make -C $$TARGET; \
49 done;
50
51run_hotplug: hotplug
52 for TARGET in $(TARGETS_HOTPLUG); do \
53 make -C $$TARGET run_full_test; \
54 done;
55
56clean_hotplug:
57 for TARGET in $(TARGETS_HOTPLUG); do \
58 make -C $$TARGET clean; \
59 done;
60
Michael Ellerman32dcfba2015-03-11 15:06:00 +110061INSTALL_PATH ?= install
62INSTALL_PATH := $(abspath $(INSTALL_PATH))
63ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
64
65install:
66ifdef INSTALL_PATH
67 @# Ask all targets to install their files
68 mkdir -p $(INSTALL_PATH)
69 for TARGET in $(TARGETS); do \
70 mkdir -p $(INSTALL_PATH)/$$TARGET ; \
71 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
72 done;
73
74 @# Ask all targets to emit their test scripts
75 echo "#!/bin/bash" > $(ALL_SCRIPT)
76 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
77 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
78
79 for TARGET in $(TARGETS); do \
80 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
81 echo "echo ========================================" >> $(ALL_SCRIPT); \
82 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
83 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
84 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
85 done;
86
87 chmod u+x $(ALL_SCRIPT)
88else
89 $(error Error: set INSTALL_PATH to use install)
90endif
91
Frederic Weisbecker274343a2012-01-12 17:20:44 -080092clean:
93 for TARGET in $(TARGETS); do \
94 make -C $$TARGET clean; \
95 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +110096
97.PHONY: install