blob: 56b11cdaa2e43005431a729dd612d6dc28063f25 [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
Tim Bird3ce51052014-12-03 10:42:21 -080016TARGETS += size
Andrew Morton96e869d2014-12-18 16:17:43 -080017TARGETS += sysctl
18TARGETS += timers
19TARGETS += user
20TARGETS += vm
Andy Lutomirski3f705df2015-04-06 23:11:06 -070021TARGETS += x86
Andrew Morton96e869d2014-12-18 16:17:43 -080022#Please keep the TARGETS list alphabetically sorted
Frederic Weisbecker274343a2012-01-12 17:20:44 -080023
Shuah Khanddddda92014-07-02 09:51:38 -060024TARGETS_HOTPLUG = cpu-hotplug
25TARGETS_HOTPLUG += memory-hotplug
26
Shuah Khan67d87122015-03-18 11:57:39 -060027# Clear LDFLAGS and MAKEFLAGS if called from main
28# Makefile to avoid test build failures when test
29# Makefile doesn't have explicit build rules.
30ifeq (1,$(MAKELEVEL))
Arnaldo Carvalho de Melo60df4642015-05-14 16:55:18 -030031override LDFLAGS =
Shuah Khan67d87122015-03-18 11:57:39 -060032override MAKEFLAGS =
33endif
34
Frederic Weisbecker274343a2012-01-12 17:20:44 -080035all:
36 for TARGET in $(TARGETS); do \
37 make -C $$TARGET; \
38 done;
39
Andrew Mortoncab6b052012-03-28 14:42:54 -070040run_tests: all
Frederic Weisbeckerf467f712012-03-28 14:42:54 -070041 for TARGET in $(TARGETS); do \
42 make -C $$TARGET run_tests; \
43 done;
44
Shuah Khanddddda92014-07-02 09:51:38 -060045hotplug:
46 for TARGET in $(TARGETS_HOTPLUG); do \
47 make -C $$TARGET; \
48 done;
49
50run_hotplug: hotplug
51 for TARGET in $(TARGETS_HOTPLUG); do \
52 make -C $$TARGET run_full_test; \
53 done;
54
55clean_hotplug:
56 for TARGET in $(TARGETS_HOTPLUG); do \
57 make -C $$TARGET clean; \
58 done;
59
Michael Ellerman32dcfba2015-03-11 15:06:00 +110060INSTALL_PATH ?= install
61INSTALL_PATH := $(abspath $(INSTALL_PATH))
62ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
63
64install:
65ifdef INSTALL_PATH
66 @# Ask all targets to install their files
67 mkdir -p $(INSTALL_PATH)
68 for TARGET in $(TARGETS); do \
69 mkdir -p $(INSTALL_PATH)/$$TARGET ; \
70 make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
71 done;
72
73 @# Ask all targets to emit their test scripts
74 echo "#!/bin/bash" > $(ALL_SCRIPT)
75 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
76 echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
77
78 for TARGET in $(TARGETS); do \
79 echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
80 echo "echo ========================================" >> $(ALL_SCRIPT); \
81 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
82 make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
83 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
84 done;
85
86 chmod u+x $(ALL_SCRIPT)
87else
88 $(error Error: set INSTALL_PATH to use install)
89endif
90
Frederic Weisbecker274343a2012-01-12 17:20:44 -080091clean:
92 for TARGET in $(TARGETS); do \
93 make -C $$TARGET clean; \
94 done;
Michael Ellerman32dcfba2015-03-11 15:06:00 +110095
96.PHONY: install