Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 1 | SUBDIRS := ion |
| 2 | |
| 3 | TEST_PROGS := run.sh |
| 4 | |
| 5 | .PHONY: all clean |
| 6 | |
| 7 | include ../lib.mk |
| 8 | |
Anders Roxell | b2d35fa | 2018-09-04 12:47:21 +0200 | [diff] [blame] | 9 | all: khdr |
Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 10 | @for DIR in $(SUBDIRS); do \ |
| 11 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
| 12 | mkdir $$BUILD_TARGET -p; \ |
| 13 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
Daniel Díaz | 64136fb | 2018-02-06 17:52:05 -0600 | [diff] [blame] | 14 | #SUBDIR test prog name should be in the form: SUBDIR_test.sh \ |
Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 15 | TEST=$$DIR"_test.sh"; \ |
Daniel Díaz | 64136fb | 2018-02-06 17:52:05 -0600 | [diff] [blame] | 16 | if [ -e $$DIR/$$TEST ]; then \ |
| 17 | rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \ |
| 18 | fi \ |
Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 19 | done |
| 20 | |
Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 21 | override define INSTALL_RULE |
| 22 | mkdir -p $(INSTALL_PATH) |
| 23 | install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) |
| 24 | |
| 25 | @for SUBDIR in $(SUBDIRS); do \ |
| 26 | BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \ |
| 27 | mkdir $$BUILD_TARGET -p; \ |
| 28 | $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ |
| 29 | done; |
| 30 | endef |
| 31 | |
Pintu Agarwal | 47a18c4 | 2017-11-01 13:00:39 -0400 | [diff] [blame] | 32 | override define CLEAN |
| 33 | @for DIR in $(SUBDIRS); do \ |
| 34 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
| 35 | mkdir $$BUILD_TARGET -p; \ |
| 36 | make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
| 37 | done |
| 38 | endef |