28ae1f7dfd98f727d83fc7f7efa9fc93ef4a0b2b
[m6w6/btr] / lib / btr / build / php.mk
1 .PHONY: all
2 .SUFFIXES:
3
4 CONFIGS=$(wildcard $(BRANCH_DIR)/ext/*/config*.m4)
5
6 all: $(TEST_REPORT)
7 TESTS_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(TEST_REPORT)); \
8 TESTS_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(TEST_REPORT)); \
9 if test -z "$(LAST_REPORT)"; then \
10 printf "%d/%d\n" $$TESTS_PASSED $$TESTS_FAILED; \
11 else \
12 LAST_PASSED=$$(awk '/^Tests passed/{print $$4}' < $(LAST_REPORT)); \
13 LAST_FAILED=$$(awk '/^Tests failed/{print $$4}' < $(LAST_REPORT)); \
14 DIFF_PASSED=$$(bc <<<"$$TESTS_PASSED - $$LAST_PASSED"); \
15 DIFF_FAILED=$$(bc <<<"$$TESTS_FAILED - $$LAST_FAILED"); \
16 printf "+%d/+%d\n" $$DIFF_PASSED $$DIFF_FAILED; \
17 fi;
18
19 $(TEST_REPORT): $(BUILD_REPORT)
20 cd $(BUILD_DIR) && \
21 make test TESTS=../$(BRANCH_DIR)/$(TESTS) > ../$@
22
23 $(BUILD_REPORT): $(CONFIG_REPORT)
24 cd $(BUILD_DIR) && \
25 make -j $(CPUS) > ../$@
26
27 $(CONFIG_REPORT): $(BRANCH_DIR)/configure $(BUILD_DIR)
28 cd $(BUILD_DIR) && \
29 ../$(BRANCH_DIR)/configure -C $(CONFIGURE) > ../$@
30
31 $(BUILD_DIR):
32 mkdir -p $@
33
34 $(BRANCH_DIR)/configure: $(BRANCH_DIR)/buildconf $(CONFIGS)
35 cd $(BRANCH_DIR) && \
36 ./buildconf > /dev/null
37
38 # vim: noet