blob: 95abddcd78397fc3b64884f6bec31a5f6005b9e8 [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
Pavel Emelyanov58c7be82013-04-30 15:27:06 -07007TARGETS += kcmp
David Herrmann4f5ce5e2014-08-08 14:25:32 -07008TARGETS += memfd
Pavel Emelyanov58c7be82013-04-30 15:27:06 -07009TARGETS += memory-hotplug
Eric W. Biedermandb181ce2014-07-29 15:50:44 -070010TARGETS += mount
Andrew Morton96e869d2014-12-18 16:17:43 -080011TARGETS += mqueue
David S. Millera6f68032013-03-20 15:07:56 -040012TARGETS += net
Michael Ellerman0e56dac2013-08-06 17:42:35 +100013TARGETS += powerpc
Andrew Morton96e869d2014-12-18 16:17:43 -080014TARGETS += ptrace
Tim Bird3ce51052014-12-03 10:42:21 -080015TARGETS += size
Andrew Morton96e869d2014-12-18 16:17:43 -080016TARGETS += sysctl
17TARGETS += timers
18TARGETS += user
19TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070020TARGETS += x86
Andrew Morton96e869d2014-12-18 16:17:43 -080021#Please keep the TARGETS list alphabetically sorted
Frederic Weisbecker274343a2012-01-12 17:20:44 -080022
Shuah Khanddddda92014-07-02 09:51:38 -060023TARGETS_HOTPLUG = cpu-hotplug
24TARGETS_HOTPLUG += memory-hotplug
25
Shuah Khan67d87122015-03-18 11:57:39 -060026# Clear LDFLAGS and MAKEFLAGS if called from main
27# Makefile to avoid test build failures when test
28# Makefile doesn't have explicit build rules.
29ifeq (1,$(MAKELEVEL))
30undefine LDFLAGS
31override MAKEFLAGS =
32endif
33
Frederic Weisbecker274343a2012-01-12 17:20:44 -080034all:
35 for TARGET in $(TARGETS); do \
36 make -C $$TARGET; \
37 done;
38
Andrew Mortoncab6b052012-03-28 14:42:54 -070039run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070040 for TARGET in $(TARGETS); do \
41 make -C $$TARGET run_tests; \
42 done;
43
Shuah Khanddddda92014-07-02 09:51:38 -060044hotplug:
45 for TARGET in $(TARGETS_HOTPLUG); do \
46 make -C $$TARGET; \
47 done;
48
49run_hotplug: hotplug
50 for TARGET in $(TARGETS_HOTPLUG); do \
51 make -C $$TARGET run_full_test; \
52 done;
53
54clean_hotplug:
55 for TARGET in $(TARGETS_HOTPLUG); do \
56 make -C $$TARGET clean; \
57 done;
58
Michael Ellerman32dcfba2015-03-11 15:06:00 +110059INSTALL_PATH ?= install
60INSTALL_PATH := $(abspath $(INSTALL_PATH))
61ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
62
63install:
64ifdef INSTALL_PATH
65 @# Ask all targets to install their files
66 mkdir -p $(INSTALL_PATH)
67 for TARGET in $(TARGETS); do \
68 mkdir -p $(INSTALL_PATH)/$$TARGET ; \
69 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
70 done;
71
72 @# Ask all targets to emit their test scripts
73 echo "#!/bin/bash" > $(ALL_SCRIPT)
74 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
75 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
76
77 for TARGET in $(TARGETS); do \
78 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
79 echo "echo ========================================" >> $(ALL_SCRIPT); \
80 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
81 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
82 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
83 done;
84
85 chmod u+x $(ALL_SCRIPT)
86else
87 $(error Error: set INSTALL_PATH to use install)
88endif
89
Frederic Weisbecker274343a2012-01-12 17:20:44 -080090clean:
91 for TARGET in $(TARGETS); do \
92 make -C $$TARGET clean; \
93 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +110094
95.PHONY: install