2015-05-13 12:07:52 +08:00
|
|
|
SUBDIRS := functional
|
|
|
|
|
2015-05-13 12:07:53 +08:00
|
|
|
TEST_PROGS := run.sh
|
|
|
|
|
2015-05-13 12:07:52 +08:00
|
|
|
.PHONY: all clean
|
|
|
|
|
2015-05-13 12:07:53 +08:00
|
|
|
include ../lib.mk
|
|
|
|
|
2016-11-29 19:55:52 +08:00
|
|
|
all:
|
|
|
|
for DIR in $(SUBDIRS); do \
|
2017-03-25 00:18:54 +08:00
|
|
|
BUILD_TARGET=$(OUTPUT)/$$DIR; \
|
2016-11-29 19:55:52 +08:00
|
|
|
mkdir $$BUILD_TARGET -p; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
2017-09-12 09:11:07 +08:00
|
|
|
if [ -e $$DIR/$(TEST_PROGS) ]; then
|
|
|
|
rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/;
|
|
|
|
fi
|
2016-11-29 19:55:52 +08:00
|
|
|
done
|
|
|
|
|
2015-05-13 12:07:53 +08:00
|
|
|
override define RUN_TESTS
|
2017-09-12 09:11:07 +08:00
|
|
|
cd $(OUTPUT); ./run.sh
|
2015-05-13 12:07:53 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
override define INSTALL_RULE
|
|
|
|
mkdir -p $(INSTALL_PATH)
|
|
|
|
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
|
|
|
|
|
|
|
|
@for SUBDIR in $(SUBDIRS); do \
|
2017-03-25 00:18:54 +08:00
|
|
|
BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \
|
2016-11-29 19:55:52 +08:00
|
|
|
mkdir $$BUILD_TARGET -p; \
|
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
|
2015-05-13 12:07:53 +08:00
|
|
|
done;
|
|
|
|
endef
|
|
|
|
|
|
|
|
override define EMIT_TESTS
|
|
|
|
echo "./run.sh"
|
|
|
|
endef
|
2015-05-13 12:07:52 +08:00
|
|
|
|
2017-04-22 06:12:22 +08:00
|
|
|
override define CLEAN
|
2016-11-29 19:55:52 +08:00
|
|
|
for DIR in $(SUBDIRS); do \
|
2017-03-25 00:18:54 +08:00
|
|
|
BUILD_TARGET=$(OUTPUT)/$$DIR; \
|
2016-11-29 19:55:52 +08:00
|
|
|
mkdir $$BUILD_TARGET -p; \
|
|
|
|
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
|
|
|
done
|
2017-04-22 06:12:22 +08:00
|
|
|
endef
|