Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Darren Hart | 2aa8470 | 2015-05-12 21:07:52 -0700 | [diff] [blame] | 2 | SUBDIRS := functional |
| 3 | |
Darren Hart | 9705315 | 2015-05-12 21:07:53 -0700 | [diff] [blame] | 4 | TEST_PROGS := run.sh |
| 5 | |
Darren Hart | 2aa8470 | 2015-05-12 21:07:52 -0700 | [diff] [blame] | 6 | .PHONY: all clean |
Darren Hart | 2aa8470 | 2015-05-12 21:07:52 -0700 | [diff] [blame] | 7 | |
Darren Hart | 9705315 | 2015-05-12 21:07:53 -0700 | [diff] [blame] | 8 | include ../lib.mk |
| 9 | |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 10 | all: |
Shuah Khan | 659dbfd | 2017-09-18 18:46:23 -0600 | [diff] [blame] | 11 | @for DIR in $(SUBDIRS); do \ |
Darren Hart | bfedc31 | 2017-03-24 09:18:54 -0700 | [diff] [blame] | 12 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 13 | mkdir $$BUILD_TARGET -p; \ |
| 14 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
Daniel Díaz | 067b25a | 2018-02-07 11:24:31 -0600 | [diff] [blame] | 15 | if [ -e $$DIR/$(TEST_PROGS) ]; then \ |
| 16 | rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \ |
| 17 | fi \ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 18 | done |
| 19 | |
Darren Hart | 9705315 | 2015-05-12 21:07:53 -0700 | [diff] [blame] | 20 | override define INSTALL_RULE |
| 21 | mkdir -p $(INSTALL_PATH) |
| 22 | install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) |
| 23 | |
| 24 | @for SUBDIR in $(SUBDIRS); do \ |
Darren Hart | bfedc31 | 2017-03-24 09:18:54 -0700 | [diff] [blame] | 25 | BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 26 | mkdir $$BUILD_TARGET -p; \ |
| 27 | $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ |
Darren Hart | 9705315 | 2015-05-12 21:07:53 -0700 | [diff] [blame] | 28 | done; |
| 29 | endef |
| 30 | |
Shuah Khan | b1c0f54 | 2017-04-21 16:12:22 -0600 | [diff] [blame] | 31 | override define CLEAN |
Shuah Khan | 659dbfd | 2017-09-18 18:46:23 -0600 | [diff] [blame] | 32 | @for DIR in $(SUBDIRS); do \ |
Darren Hart | bfedc31 | 2017-03-24 09:18:54 -0700 | [diff] [blame] | 33 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
bamvor.zhangjian@huawei.com | a8ba798 | 2016-11-29 19:55:52 +0800 | [diff] [blame] | 34 | mkdir $$BUILD_TARGET -p; \ |
| 35 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
| 36 | done |
Shuah Khan | b1c0f54 | 2017-04-21 16:12:22 -0600 | [diff] [blame] | 37 | endef |