2016-10-17 20:28:36 +08:00
|
|
|
TARGETS = bpf
|
|
|
|
TARGETS += breakpoints
|
2015-11-17 22:35:42 +08:00
|
|
|
TARGETS += capabilities
|
2017-01-13 14:36:45 +08:00
|
|
|
TARGETS += cpufreq
|
2013-05-01 06:27:06 +08:00
|
|
|
TARGETS += cpu-hotplug
|
|
|
|
TARGETS += efivarfs
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += exec
|
|
|
|
TARGETS += firmware
|
|
|
|
TARGETS += ftrace
|
2015-05-13 12:07:55 +08:00
|
|
|
TARGETS += futex
|
2016-11-21 18:16:11 +08:00
|
|
|
TARGETS += gpio
|
2017-01-11 23:16:07 +08:00
|
|
|
TARGETS += intel_pstate
|
2015-11-17 22:35:43 +08:00
|
|
|
TARGETS += ipc
|
2013-02-28 09:05:56 +08:00
|
|
|
TARGETS += kcmp
|
2015-11-07 08:30:32 +08:00
|
|
|
TARGETS += lib
|
2015-09-12 04:07:42 +08:00
|
|
|
TARGETS += membarrier
|
2014-08-09 05:25:32 +08:00
|
|
|
TARGETS += memfd
|
2013-05-01 06:27:06 +08:00
|
|
|
TARGETS += memory-hotplug
|
2014-07-30 06:50:44 +08:00
|
|
|
TARGETS += mount
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += mqueue
|
2013-03-21 03:07:56 +08:00
|
|
|
TARGETS += net
|
2016-09-06 15:47:16 +08:00
|
|
|
TARGETS += nsfs
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += powerpc
|
2015-10-02 19:46:39 +08:00
|
|
|
TARGETS += pstore
|
2013-05-01 06:28:00 +08:00
|
|
|
TARGETS += ptrace
|
2015-06-17 01:54:14 +08:00
|
|
|
TARGETS += seccomp
|
2016-04-15 04:20:05 +08:00
|
|
|
TARGETS += sigaltstack
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += size
|
2017-02-19 11:07:24 +08:00
|
|
|
TARGETS += splice
|
2015-09-09 21:06:25 +08:00
|
|
|
TARGETS += static_keys
|
2016-10-19 20:49:48 +08:00
|
|
|
TARGETS += sync
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += sysctl
|
2015-06-20 03:13:43 +08:00
|
|
|
ifneq (1, $(quicktest))
|
2013-06-28 08:06:43 +08:00
|
|
|
TARGETS += timers
|
2015-06-20 03:13:43 +08:00
|
|
|
endif
|
2014-01-24 07:54:38 +08:00
|
|
|
TARGETS += user
|
2014-12-19 08:17:43 +08:00
|
|
|
TARGETS += vm
|
2015-04-07 14:11:06 +08:00
|
|
|
TARGETS += x86
|
2015-08-18 15:01:59 +08:00
|
|
|
TARGETS += zram
|
2014-12-19 08:17:43 +08:00
|
|
|
#Please keep the TARGETS list alphabetically sorted
|
2015-06-20 03:13:43 +08:00
|
|
|
# Run "make quicktest=1 run_tests" or
|
2017-04-14 07:43:16 +08:00
|
|
|
# "make quicktest=1 kselftest" from top level Makefile
|
2012-01-13 09:20:44 +08:00
|
|
|
|
2014-07-02 23:51:38 +08:00
|
|
|
TARGETS_HOTPLUG = cpu-hotplug
|
|
|
|
TARGETS_HOTPLUG += memory-hotplug
|
|
|
|
|
2015-03-19 01:57:39 +08:00
|
|
|
# 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))
|
2015-05-15 03:55:18 +08:00
|
|
|
override LDFLAGS =
|
2015-03-19 01:57:39 +08:00
|
|
|
override MAKEFLAGS =
|
|
|
|
endif
|
|
|
|
|
2017-09-08 09:57:43 +08:00
|
|
|
ifneq ($(KBUILD_SRC),)
|
|
|
|
override LDFLAGS =
|
|
|
|
endif
|
|
|
|
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD := $(O)
|
|
|
|
ifndef BUILD
|
|
|
|
BUILD := $(KBUILD_OUTPUT)
|
|
|
|
endif
|
|
|
|
ifndef BUILD
|
|
|
|
BUILD := $(shell pwd)
|
|
|
|
endif
|
|
|
|
|
|
|
|
export BUILD
|
2012-01-13 09:20:44 +08:00
|
|
|
all:
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
mkdir $$BUILD_TARGET -p; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
|
2012-01-13 09:20:44 +08:00
|
|
|
done;
|
|
|
|
|
2012-03-29 05:42:54 +08:00
|
|
|
run_tests: all
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
|
2012-03-29 05:42:54 +08:00
|
|
|
done;
|
|
|
|
|
2014-07-02 23:51:38 +08:00
|
|
|
hotplug:
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET;\
|
2014-07-02 23:51:38 +08:00
|
|
|
done;
|
|
|
|
|
|
|
|
run_hotplug: hotplug
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\
|
2014-07-02 23:51:38 +08:00
|
|
|
done;
|
|
|
|
|
|
|
|
clean_hotplug:
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
|
2014-07-02 23:51:38 +08:00
|
|
|
done;
|
|
|
|
|
2015-10-02 19:46:41 +08:00
|
|
|
run_pstore_crash:
|
|
|
|
make -C pstore run_crash
|
|
|
|
|
2015-03-11 12:06:00 +08:00
|
|
|
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)
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
|
2015-03-11 12:06:00 +08:00
|
|
|
done;
|
|
|
|
|
|
|
|
@# Ask all targets to emit their test scripts
|
2016-12-14 18:59:34 +08:00
|
|
|
echo "#!/bin/sh" > $(ALL_SCRIPT)
|
2015-03-11 12:06:00 +08:00
|
|
|
echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
|
|
|
|
echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
|
|
|
|
|
|
|
|
for TARGET in $(TARGETS); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2015-03-11 12:06:00 +08:00
|
|
|
echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
|
|
|
|
echo "echo ========================================" >> $(ALL_SCRIPT); \
|
|
|
|
echo "cd $$TARGET" >> $(ALL_SCRIPT); \
|
2016-11-29 19:55:52 +08:00
|
|
|
make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
|
2015-03-11 12:06:00 +08:00
|
|
|
echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
|
|
|
|
done;
|
|
|
|
|
|
|
|
chmod u+x $(ALL_SCRIPT)
|
|
|
|
else
|
|
|
|
$(error Error: set INSTALL_PATH to use install)
|
|
|
|
endif
|
|
|
|
|
2012-01-13 09:20:44 +08:00
|
|
|
clean:
|
2017-09-19 07:30:50 +08:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 19:55:52 +08:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
|
2012-01-13 09:20:44 +08:00
|
|
|
done;
|
2015-03-11 12:06:00 +08:00
|
|
|
|
2017-04-14 07:44:46 +08:00
|
|
|
.PHONY: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean
|