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 done 15 16override define RUN_TESTS 17 @if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi 18endef 19 20override 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 \ 25 BUILD_TARGET=$$OUTPUT/$$SUBDIR; \ 26 mkdir $$BUILD_TARGET -p; \ 27 $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ 28 done; 29endef 30 31override define EMIT_TESTS 32 echo "./run.sh" 33endef 34 35clean: 36 for DIR in $(SUBDIRS); do \ 37 BUILD_TARGET=$$OUTPUT/$$DIR; \ 38 mkdir $$BUILD_TARGET -p; \ 39 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ 40 done 41