Makefile 2.5 KB
Newer Older
1
TARGETS = breakpoints
2
TARGETS += capabilities
3 4
TARGETS += cpu-hotplug
TARGETS += efivarfs
5 6 7
TARGETS += exec
TARGETS += firmware
TARGETS += ftrace
8
TARGETS += futex
B
Bamvor Jian Zhang 已提交
9
TARGETS += ipc
10
TARGETS += kcmp
K
Kees Cook 已提交
11
TARGETS += lib
12
TARGETS += membarrier
13
TARGETS += memfd
14
TARGETS += memory-hotplug
15
TARGETS += mount
16
TARGETS += mqueue
17
TARGETS += net
18
TARGETS += nsfs
19
TARGETS += powerpc
20
TARGETS += pstore
21
TARGETS += ptrace
K
Kees Cook 已提交
22
TARGETS += seccomp
23
TARGETS += sigaltstack
24
TARGETS += size
25
TARGETS += static_keys
26
TARGETS += sync
27
TARGETS += sysctl
S
Shuah Khan 已提交
28
ifneq (1, $(quicktest))
29
TARGETS += timers
S
Shuah Khan 已提交
30
endif
31
TARGETS += user
32
TARGETS += vm
33
TARGETS += x86
34
TARGETS += zram
35
#Please keep the TARGETS list alphabetically sorted
S
Shuah Khan 已提交
36 37
# Run "make quicktest=1 run_tests" or
# "make quicktest=1 kselftest from top level Makefile
38

39 40 41
TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug

42 43 44 45
# Clear LDFLAGS and MAKEFLAGS if called from main
# Makefile to avoid test build failures when test
# Makefile doesn't have explicit build rules.
ifeq (1,$(MAKELEVEL))
46
override LDFLAGS =
47 48 49
override MAKEFLAGS =
endif

50 51 52 53 54
all:
	for TARGET in $(TARGETS); do \
		make -C $$TARGET; \
	done;

55
run_tests: all
56 57 58 59
	for TARGET in $(TARGETS); do \
		make -C $$TARGET run_tests; \
	done;

60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
hotplug:
	for TARGET in $(TARGETS_HOTPLUG); do \
		make -C $$TARGET; \
	done;

run_hotplug: hotplug
	for TARGET in $(TARGETS_HOTPLUG); do \
		make -C $$TARGET run_full_test; \
	done;

clean_hotplug:
	for TARGET in $(TARGETS_HOTPLUG); do \
		make -C $$TARGET clean; \
	done;

75 76 77
run_pstore_crash:
	make -C pstore run_crash

M
Michael Ellerman 已提交
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
INSTALL_PATH ?= install
INSTALL_PATH := $(abspath $(INSTALL_PATH))
ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh

install:
ifdef INSTALL_PATH
	@# Ask all targets to install their files
	mkdir -p $(INSTALL_PATH)
	for TARGET in $(TARGETS); do \
		make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
	done;

	@# Ask all targets to emit their test scripts
	echo "#!/bin/bash" > $(ALL_SCRIPT)
	echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
	echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)

	for TARGET in $(TARGETS); do \
		echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
		echo "echo ========================================" >> $(ALL_SCRIPT); \
		echo "cd $$TARGET" >> $(ALL_SCRIPT); \
		make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
		echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
	done;

	chmod u+x $(ALL_SCRIPT)
else
	$(error Error: set INSTALL_PATH to use install)
endif

108 109 110 111
clean:
	for TARGET in $(TARGETS); do \
		make -C $$TARGET clean; \
	done;
M
Michael Ellerman 已提交
112 113

.PHONY: install