1# SPDX-License-Identifier: GPL-2.0 2SUBDIRS := functional 3 4TEST_PROGS := run.sh 5 6include ../lib.mk 7 8all: 9 @for DIR in $(SUBDIRS); do \ 10 BUILD_TARGET=$(OUTPUT)/$$DIR; \ 11 mkdir $$BUILD_TARGET -p; \ 12 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ 13 if [ -e $$DIR/$(TEST_PROGS) ]; then \ 14 rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \ 15 fi \ 16 done 17 18override define INSTALL_RULE 19 mkdir -p $(INSTALL_PATH) 20 install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) 21 22 @for SUBDIR in $(SUBDIRS); do \ 23 BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \ 24 mkdir $$BUILD_TARGET -p; \ 25 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ 26 done; 27endef 28 29override define CLEAN 30 @for DIR in $(SUBDIRS); do \ 31 BUILD_TARGET=$(OUTPUT)/$$DIR; \ 32 mkdir $$BUILD_TARGET -p; \ 33 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ 34 done 35endef 36