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