Makefile 2.1 KB
Newer Older
1
TARGETS = breakpoints
2 3
TARGETS += cpu-hotplug
TARGETS += efivarfs
4 5 6
TARGETS += exec
TARGETS += firmware
TARGETS += ftrace
7
TARGETS += futex
8
TARGETS += kcmp
9
TARGETS += memfd
10
TARGETS += memory-hotplug
11
TARGETS += mount
12
TARGETS += mqueue
13
TARGETS += net
14
TARGETS += powerpc
15
TARGETS += ptrace
16 17
TARGETS += size
TARGETS += sysctl
18
TARGETS += timers
19
TARGETS += user
20
TARGETS += vm
21
TARGETS += x86
22
#Please keep the TARGETS list alphabetically sorted
23

24 25 26
TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug

27 28 29 30 31 32 33 34
# 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))
undefine LDFLAGS
override MAKEFLAGS =
endif

35 36 37 38 39
all:
	for TARGET in $(TARGETS); do \
		make -C $$TARGET; \
	done;

40
run_tests: all
41 42 43 44
	for TARGET in $(TARGETS); do \
		make -C $$TARGET run_tests; \
	done;

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
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;

M
Michael Ellerman 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
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 \
		mkdir -p $(INSTALL_PATH)/$$TARGET ; \
		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

91 92 93 94
clean:
	for TARGET in $(TARGETS); do \
		make -C $$TARGET clean; \
	done;
M
Michael Ellerman 已提交
95 96

.PHONY: install