blob: 12631f0076a10274dff566228b05748e9a217be0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Darren Hart2aa84702015-05-12 21:07:52 -07002SUBDIRS := functional
3
Darren Hart97053152015-05-12 21:07:53 -07004TEST_PROGS := run.sh
5
Darren Hart2aa84702015-05-12 21:07:52 -07006.PHONY: all clean
Darren Hart2aa84702015-05-12 21:07:52 -07007
Darren Hart97053152015-05-12 21:07:53 -07008include ../lib.mk
9
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080010all:
Shuah Khan659dbfd2017-09-18 18:46:23 -060011 @for DIR in $(SUBDIRS); do \
Darren Hartbfedc312017-03-24 09:18:54 -070012 BUILD_TARGET=$(OUTPUT)/$$DIR; \
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080013 mkdir $$BUILD_TARGET -p; \
14 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
Daniel Díaz067b25a2018-02-07 11:24:31 -060015 if [ -e $$DIR/$(TEST_PROGS) ]; then \
16 rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
17 fi \
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080018 done
19
Darren Hart97053152015-05-12 21:07:53 -070020override 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 Hartbfedc312017-03-24 09:18:54 -070025 BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080026 mkdir $$BUILD_TARGET -p; \
27 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
Darren Hart97053152015-05-12 21:07:53 -070028 done;
29endef
30
Shuah Khanb1c0f542017-04-21 16:12:22 -060031override define CLEAN
Shuah Khan659dbfd2017-09-18 18:46:23 -060032 @for DIR in $(SUBDIRS); do \
Darren Hartbfedc312017-03-24 09:18:54 -070033 BUILD_TARGET=$(OUTPUT)/$$DIR; \
bamvor.zhangjian@huawei.coma8ba7982016-11-29 19:55:52 +080034 mkdir $$BUILD_TARGET -p; \
35 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
36 done
Shuah Khanb1c0f542017-04-21 16:12:22 -060037endef