1 # SPDX-License-Identifier: GPL-2.0
5 TARGETS
+= capabilities
14 TARGETS
+= intel_pstate
20 TARGETS
+= memory-hotplug
29 TARGETS
+= sigaltstack
32 TARGETS
+= static_keys
35 ifneq (1, $(quicktest
))
42 #Please keep the TARGETS list alphabetically sorted
43 # Run "make quicktest=1 run_tests" or
44 # "make quicktest=1 kselftest" from top level Makefile
46 TARGETS_HOTPLUG
= cpu-hotplug
47 TARGETS_HOTPLUG
+= memory-hotplug
49 # Clear LDFLAGS and MAKEFLAGS if called from main
50 # Makefile to avoid test build failures when test
51 # Makefile doesn't have explicit build rules.
57 ifneq ($(KBUILD_SRC
),)
63 BUILD
:= $(KBUILD_OUTPUT
)
71 @for TARGET in
$(TARGETS
); do \
72 BUILD_TARGET
=$$BUILD/$$TARGET; \
73 mkdir
$$BUILD_TARGET -p
; \
74 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET;\
78 @for TARGET in
$(TARGETS
); do \
79 BUILD_TARGET
=$$BUILD/$$TARGET; \
80 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET run_tests
;\
84 @for TARGET in
$(TARGETS_HOTPLUG
); do \
85 BUILD_TARGET
=$$BUILD/$$TARGET; \
86 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET;\
90 @for TARGET in
$(TARGETS_HOTPLUG
); do \
91 BUILD_TARGET
=$$BUILD/$$TARGET; \
92 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET run_full_test
;\
96 @for TARGET in
$(TARGETS_HOTPLUG
); do \
97 BUILD_TARGET
=$$BUILD/$$TARGET; \
98 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET clean;\
102 make
-C pstore run_crash
104 INSTALL_PATH ?
= install
105 INSTALL_PATH
:= $(abspath
$(INSTALL_PATH
))
106 ALL_SCRIPT
:= $(INSTALL_PATH
)/run_kselftest.sh
110 @
# Ask all targets to install their files
111 mkdir
-p
$(INSTALL_PATH
)
112 @for TARGET in
$(TARGETS
); do \
113 BUILD_TARGET
=$$BUILD/$$TARGET; \
114 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET INSTALL_PATH
=$(INSTALL_PATH
)/$$TARGET install; \
117 @
# Ask all targets to emit their test scripts
118 echo
"#!/bin/sh" > $(ALL_SCRIPT
)
119 echo
"BASE_DIR=\$$(realpath \$$(dirname \$$0))" >> $(ALL_SCRIPT
)
120 echo
"cd \$$BASE_DIR" >> $(ALL_SCRIPT
)
121 echo
"ROOT=\$$PWD" >> $(ALL_SCRIPT
)
122 echo
"if [ \"\$$1\" = \"--summary\" ]; then" >> $(ALL_SCRIPT
)
123 echo
" OUTPUT=\$$BASE_DIR/output.log" >> $(ALL_SCRIPT
)
124 echo
" cat /dev/null > \$$OUTPUT" >> $(ALL_SCRIPT
)
125 echo
"else" >> $(ALL_SCRIPT
)
126 echo
" OUTPUT=/dev/stdout" >> $(ALL_SCRIPT
)
127 echo
"fi" >> $(ALL_SCRIPT
)
129 for TARGET in
$(TARGETS
); do \
130 BUILD_TARGET
=$$BUILD/$$TARGET; \
131 echo
"echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT
); \
132 echo
"echo ========================================" >> $(ALL_SCRIPT
); \
133 echo
"cd $$TARGET" >> $(ALL_SCRIPT
); \
134 make
-s
--no-print-directory OUTPUT
=$$BUILD_TARGET -C
$$TARGET emit_tests
>> $(ALL_SCRIPT
); \
135 echo
"cd \$$ROOT" >> $(ALL_SCRIPT
); \
138 chmod u
+x
$(ALL_SCRIPT
)
140 $(error Error
: set INSTALL_PATH to use
install)
144 @for TARGET in
$(TARGETS
); do \
145 BUILD_TARGET
=$$BUILD/$$TARGET; \
146 make OUTPUT
=$$BUILD_TARGET -C
$$TARGET clean;\
149 .PHONY
: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash
install clean