2019-08-14 14:58:24 +02:00
|
|
|
.PHONY: buildtest buildtest-indocker
|
2014-08-13 21:24:07 +02:00
|
|
|
|
2018-08-08 14:34:48 +02:00
|
|
|
BUILDTEST_MAKE_REDIRECT ?= >/dev/null 2>&1
|
|
|
|
|
2014-05-14 13:46:27 +02:00
|
|
|
buildtest:
|
2014-10-06 17:21:37 +02:00
|
|
|
@ \
|
2017-09-09 00:06:29 +02:00
|
|
|
RESULT=true ; \
|
|
|
|
for board in $(BOARDS); do \
|
2018-08-07 18:42:38 +02:00
|
|
|
if BOARD=$${board} $(MAKE) check-toolchain-supported > /dev/null 2>&1; then \
|
|
|
|
$(COLOR_ECHO) -n "Building for $$board ... " ; \
|
2019-07-01 18:57:41 +02:00
|
|
|
BOARD=$${board} RIOT_CI_BUILD=1 \
|
2018-08-07 18:42:38 +02:00
|
|
|
$(MAKE) clean all -j $(NPROC) $(BUILDTEST_MAKE_REDIRECT); \
|
|
|
|
RES=$$? ; \
|
|
|
|
if [ $$RES -eq 0 ]; then \
|
|
|
|
$(COLOR_ECHO) "$(COLOR_GREEN)success.$(COLOR_RESET)" ; \
|
|
|
|
else \
|
|
|
|
$(COLOR_ECHO) "$(COLOR_RED)failed!$(COLOR_RESET)" ; \
|
|
|
|
RESULT=false ; \
|
|
|
|
fi ; \
|
2018-08-23 15:56:36 +02:00
|
|
|
BOARD=$${board} $(MAKE) clean-intermediates >/dev/null 2>&1 || true; \
|
2018-08-07 18:42:38 +02:00
|
|
|
fi; \
|
2017-09-09 00:06:29 +02:00
|
|
|
done ; \
|
|
|
|
$${RESULT}
|
2019-08-14 14:58:24 +02:00
|
|
|
|
|
|
|
# Define 'buildtest-indocker' completely executed inside the container.
|
2019-09-14 15:47:10 +02:00
|
|
|
# It prevents starting one container per compilation which is slower but it
|
2019-08-14 14:58:24 +02:00
|
|
|
# could hide errors where the host toolchain would be used
|
|
|
|
ifeq ($(BUILD_IN_DOCKER),1)
|
|
|
|
buildtest-indocker: ..in-docker-container
|
|
|
|
else
|
|
|
|
ifeq ($(INSIDE_DOCKER),1)
|
|
|
|
buildtest-indocker: buildtest
|
|
|
|
else
|
|
|
|
buildtest-indocker:
|
|
|
|
$(error $@ must be run with `BUILD_IN_DOCKER=1`)
|
|
|
|
endif # INSIDE_DOCKER
|
|
|
|
endif # BUILD_IN_DOCKER
|