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