Commit | Line | Data |
---|---|---|
66a01b96 | 1 | TARGETS = breakpoints |
58c7be84 PE |
2 | TARGETS += cpu-hotplug |
3 | TARGETS += efivarfs | |
96e869d8 AM |
4 | TARGETS += exec |
5 | TARGETS += firmware | |
6 | TARGETS += ftrace | |
ecac1a75 | 7 | TARGETS += futex |
66a01b96 | 8 | TARGETS += kcmp |
317dc34a | 9 | TARGETS += lib |
b6d97344 | 10 | TARGETS += membarrier |
4f5ce5e8 | 11 | TARGETS += memfd |
58c7be84 | 12 | TARGETS += memory-hotplug |
db181ce0 | 13 | TARGETS += mount |
96e869d8 | 14 | TARGETS += mqueue |
a6f68034 | 15 | TARGETS += net |
96e869d8 | 16 | TARGETS += powerpc |
cc04a46f | 17 | TARGETS += pstore |
17afab1d | 18 | TARGETS += ptrace |
c99ee51a | 19 | TARGETS += seccomp |
96e869d8 | 20 | TARGETS += size |
1087d019 | 21 | TARGETS += static_keys |
96e869d8 | 22 | TARGETS += sysctl |
2278e5ed | 23 | ifneq (1, $(quicktest)) |
0bc4b0cf | 24 | TARGETS += timers |
2278e5ed | 25 | endif |
3e2a4c18 | 26 | TARGETS += user |
96e869d8 | 27 | TARGETS += vm |
3f705dfd | 28 | TARGETS += x86 |
f21fb798 | 29 | TARGETS += zram |
96e869d8 | 30 | #Please keep the TARGETS list alphabetically sorted |
2278e5ed SK |
31 | # Run "make quicktest=1 run_tests" or |
32 | # "make quicktest=1 kselftest from top level Makefile | |
274343ad | 33 | |
ddddda9b SK |
34 | TARGETS_HOTPLUG = cpu-hotplug |
35 | TARGETS_HOTPLUG += memory-hotplug | |
36 | ||
67d8712d SK |
37 | # Clear LDFLAGS and MAKEFLAGS if called from main |
38 | # Makefile to avoid test build failures when test | |
39 | # Makefile doesn't have explicit build rules. | |
40 | ifeq (1,$(MAKELEVEL)) | |
60df4642 | 41 | override LDFLAGS = |
67d8712d SK |
42 | override MAKEFLAGS = |
43 | endif | |
44 | ||
274343ad FW |
45 | all: |
46 | for TARGET in $(TARGETS); do \ | |
47 | make -C $$TARGET; \ | |
48 | done; | |
49 | ||
cab6b056 | 50 | run_tests: all |
f467f714 FW |
51 | for TARGET in $(TARGETS); do \ |
52 | make -C $$TARGET run_tests; \ | |
53 | done; | |
54 | ||
ddddda9b SK |
55 | hotplug: |
56 | for TARGET in $(TARGETS_HOTPLUG); do \ | |
57 | make -C $$TARGET; \ | |
58 | done; | |
59 | ||
60 | run_hotplug: hotplug | |
61 | for TARGET in $(TARGETS_HOTPLUG); do \ | |
62 | make -C $$TARGET run_full_test; \ | |
63 | done; | |
64 | ||
65 | clean_hotplug: | |
66 | for TARGET in $(TARGETS_HOTPLUG); do \ | |
67 | make -C $$TARGET clean; \ | |
68 | done; | |
69 | ||
f615e2bb HT |
70 | run_pstore_crash: |
71 | make -C pstore run_crash | |
72 | ||
32dcfba6 ME |
73 | INSTALL_PATH ?= install |
74 | INSTALL_PATH := $(abspath $(INSTALL_PATH)) | |
75 | ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh | |
76 | ||
77 | install: | |
78 | ifdef INSTALL_PATH | |
79 | @# Ask all targets to install their files | |
80 | mkdir -p $(INSTALL_PATH) | |
81 | for TARGET in $(TARGETS); do \ | |
32dcfba6 ME |
82 | make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ |
83 | done; | |
84 | ||
85 | @# Ask all targets to emit their test scripts | |
86 | echo "#!/bin/bash" > $(ALL_SCRIPT) | |
87 | echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT) | |
88 | echo "ROOT=\$$PWD" >> $(ALL_SCRIPT) | |
89 | ||
90 | for TARGET in $(TARGETS); do \ | |
91 | echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ | |
92 | echo "echo ========================================" >> $(ALL_SCRIPT); \ | |
93 | echo "cd $$TARGET" >> $(ALL_SCRIPT); \ | |
94 | make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ | |
95 | echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ | |
96 | done; | |
97 | ||
98 | chmod u+x $(ALL_SCRIPT) | |
99 | else | |
100 | $(error Error: set INSTALL_PATH to use install) | |
101 | endif | |
102 | ||
274343ad FW |
103 | clean: |
104 | for TARGET in $(TARGETS); do \ | |
105 | make -C $$TARGET clean; \ | |
106 | done; | |
32dcfba6 ME |
107 | |
108 | .PHONY: install |