Skip to content

Commit

Permalink
makefiles/buildtest: add a buildtest-indocker
Browse files Browse the repository at this point in the history
Add a 'buildtest-indocker' that forces executing 'buildtest' for loop
completely inside the container.
It prevents starting one container per compilation wich is slower but
it could hide errors where the host toolchain would be used

It is currently equivalent to `buildtest` but will change when the
`buidtest` handling will be move outside of `BUILD_IN_DOCKER`.

Display an error when executed without BUILD_IN_DOCKER=1.
  • Loading branch information
cladmi committed Aug 14, 2019
1 parent 414df99 commit a048001
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ include $(RIOTMAKE)/info-nproc.inc.mk
# List of boards variables
include $(RIOTMAKE)/boards.inc.mk

GLOBAL_GOALS += buildtest info-boards-supported info-boards-features-missing info-buildsizes info-buildsizes-diff
GLOBAL_GOALS += buildtest buildtest-indocker info-boards-supported info-boards-features-missing info-buildsizes info-buildsizes-diff
ifneq (, $(filter $(GLOBAL_GOALS), $(MAKECMDGOALS)))
BOARD=none
endif
Expand Down
16 changes: 15 additions & 1 deletion makefiles/buildtests.inc.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: buildtest
.PHONY: buildtest buildtest-indocker

BUILDTEST_MAKE_REDIRECT ?= >/dev/null 2>&1

Expand All @@ -25,3 +25,17 @@ buildtest:
done ; \
$${RESULT}
endif # BUILD_IN_DOCKER

# Define 'buildtest-indocker' completely executed inside the container.
# It prevents starting one container per compilation wich is slower but it
# 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
1 change: 1 addition & 0 deletions makefiles/docker.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export DOCKER_FLAGS ?= --rm
export DOCKER_MAKECMDGOALS_POSSIBLE = \
all \
buildtest \
buildtest-indocker \
scan-build \
scan-build-analyze \
tests-% \
Expand Down

0 comments on commit a048001

Please sign in to comment.