Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 1 | TARGETS = breakpoints |
Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 2 | TARGETS += cpu-hotplug |
Andrew Morton | 66a01b9 | 2013-02-27 17:05:56 -0800 | [diff] [blame] | 3 | TARGETS += efivarfs |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 4 | TARGETS += exec |
| 5 | TARGETS += firmware |
| 6 | TARGETS += ftrace |
Pavel Emelyanov | 58c7be8 | 2013-04-30 15:27:06 -0700 | [diff] [blame] | 7 | TARGETS += kcmp |
David Herrmann | 4f5ce5e | 2014-08-08 14:25:32 -0700 | [diff] [blame] | 8 | TARGETS += memfd |
Pavel Emelyanov | 58c7be8 | 2013-04-30 15:27:06 -0700 | [diff] [blame] | 9 | TARGETS += memory-hotplug |
Eric W. Biederman | db181ce | 2014-07-29 15:50:44 -0700 | [diff] [blame] | 10 | TARGETS += mount |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 11 | TARGETS += mqueue |
David S. Miller | a6f6803 | 2013-03-20 15:07:56 -0400 | [diff] [blame] | 12 | TARGETS += net |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 13 | TARGETS += powerpc |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 14 | TARGETS += ptrace |
Tim Bird | 3ce5105 | 2014-12-03 10:42:21 -0800 | [diff] [blame] | 15 | TARGETS += size |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 16 | TARGETS += sysctl |
| 17 | TARGETS += timers |
| 18 | TARGETS += user |
| 19 | TARGETS += vm |
Andy Lutomirski | 3f705df | 2015-04-06 23:11:06 -0700 | [diff] [blame] | 20 | TARGETS += x86 |
Andrew Morton | 96e869d | 2014-12-18 16:17:43 -0800 | [diff] [blame] | 21 | #Please keep the TARGETS list alphabetically sorted |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 22 | |
Shuah Khan | ddddda9 | 2014-07-02 09:51:38 -0600 | [diff] [blame] | 23 | TARGETS_HOTPLUG = cpu-hotplug |
| 24 | TARGETS_HOTPLUG += memory-hotplug |
| 25 | |
Shuah Khan | 67d8712 | 2015-03-18 11:57:39 -0600 | [diff] [blame] | 26 | # Clear LDFLAGS and MAKEFLAGS if called from main |
| 27 | # Makefile to avoid test build failures when test |
| 28 | # Makefile doesn't have explicit build rules. |
| 29 | ifeq (1,$(MAKELEVEL)) |
| 30 | undefine LDFLAGS |
| 31 | override MAKEFLAGS = |
| 32 | endif |
| 33 | |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 34 | all: |
| 35 | for TARGET in $(TARGETS); do \ |
| 36 | make -C $$TARGET; \ |
| 37 | done; |
| 38 | |
Andrew Morton | cab6b05 | 2012-03-28 14:42:54 -0700 | [diff] [blame] | 39 | run_tests: all |
Frederic Weisbecker | f467f71 | 2012-03-28 14:42:54 -0700 | [diff] [blame] | 40 | for TARGET in $(TARGETS); do \ |
| 41 | make -C $$TARGET run_tests; \ |
| 42 | done; |
| 43 | |
Shuah Khan | ddddda9 | 2014-07-02 09:51:38 -0600 | [diff] [blame] | 44 | hotplug: |
| 45 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 46 | make -C $$TARGET; \ |
| 47 | done; |
| 48 | |
| 49 | run_hotplug: hotplug |
| 50 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 51 | make -C $$TARGET run_full_test; \ |
| 52 | done; |
| 53 | |
| 54 | clean_hotplug: |
| 55 | for TARGET in $(TARGETS_HOTPLUG); do \ |
| 56 | make -C $$TARGET clean; \ |
| 57 | done; |
| 58 | |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 59 | INSTALL_PATH ?= install |
| 60 | INSTALL_PATH := $(abspath $(INSTALL_PATH)) |
| 61 | ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh |
| 62 | |
| 63 | install: |
| 64 | ifdef INSTALL_PATH |
| 65 | @# Ask all targets to install their files |
| 66 | mkdir -p $(INSTALL_PATH) |
| 67 | for TARGET in $(TARGETS); do \ |
| 68 | mkdir -p $(INSTALL_PATH)/$$TARGET ; \ |
| 69 | make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ |
| 70 | done; |
| 71 | |
| 72 | @# Ask all targets to emit their test scripts |
| 73 | echo "#!/bin/bash" > $(ALL_SCRIPT) |
| 74 | echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT) |
| 75 | echo "ROOT=\$$PWD" >> $(ALL_SCRIPT) |
| 76 | |
| 77 | for TARGET in $(TARGETS); do \ |
| 78 | echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \ |
| 79 | echo "echo ========================================" >> $(ALL_SCRIPT); \ |
| 80 | echo "cd $$TARGET" >> $(ALL_SCRIPT); \ |
| 81 | make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \ |
| 82 | echo "cd \$$ROOT" >> $(ALL_SCRIPT); \ |
| 83 | done; |
| 84 | |
| 85 | chmod u+x $(ALL_SCRIPT) |
| 86 | else |
| 87 | $(error Error: set INSTALL_PATH to use install) |
| 88 | endif |
| 89 | |
Frederic Weisbecker | 274343a | 2012-01-12 17:20:44 -0800 | [diff] [blame] | 90 | clean: |
| 91 | for TARGET in $(TARGETS); do \ |
| 92 | make -C $$TARGET clean; \ |
| 93 | done; |
Michael Ellerman | 32dcfba | 2015-03-11 15:06:00 +1100 | [diff] [blame] | 94 | |
| 95 | .PHONY: install |