blob: 9af1df28bb26731c5ba207ba65b733dec92ea0b4 [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
20#Please keep the TARGETS list alphabetically sorted
Frederic Weisbecker274343a2012-01-12 17:20:44 -080021
Shuah Khanddddda92014-07-02 09:51:38 -060022TARGETS_HOTPLUG = cpu-hotplug
23TARGETS_HOTPLUG += memory-hotplug
24
Frederic Weisbecker274343a2012-01-12 17:20:44 -080025all:
26 for TARGET in $(TARGETS); do \
27 make -C $$TARGET; \
28 done;
29
Andrew Mortoncab6b052012-03-28 14:42:54 -070030run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070031 for TARGET in $(TARGETS); do \
32 make -C $$TARGET run_tests; \
33 done;
34
Shuah Khanddddda92014-07-02 09:51:38 -060035hotplug:
36 for TARGET in $(TARGETS_HOTPLUG); do \
37 make -C $$TARGET; \
38 done;
39
40run_hotplug: hotplug
41 for TARGET in $(TARGETS_HOTPLUG); do \
42 make -C $$TARGET run_full_test; \
43 done;
44
45clean_hotplug:
46 for TARGET in $(TARGETS_HOTPLUG); do \
47 make -C $$TARGET clean; \
48 done;
49
Michael Ellerman32dcfba2015-03-11 15:06:00 +110050INSTALL_PATH ?= install
51INSTALL_PATH := $(abspath $(INSTALL_PATH))
52ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
53
54install:
55ifdef INSTALL_PATH
56 @# Ask all targets to install their files
57 mkdir -p $(INSTALL_PATH)
58 for TARGET in $(TARGETS); do \
59 mkdir -p $(INSTALL_PATH)/$$TARGET ; \
60 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
61 done;
62
63 @# Ask all targets to emit their test scripts
64 echo "#!/bin/bash" > $(ALL_SCRIPT)
65 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
66 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
67
68 for TARGET in $(TARGETS); do \
69 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
70 echo "echo ========================================" >> $(ALL_SCRIPT); \
71 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
72 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
73 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
74 done;
75
76 chmod u+x $(ALL_SCRIPT)
77else
78 $(error Error: set INSTALL_PATH to use install)
79endif
80
Frederic Weisbecker274343a2012-01-12 17:20:44 -080081clean:
82 for TARGET in $(TARGETS); do \
83 make -C $$TARGET clean; \
84 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +110085
86.PHONY: install