From 2664f536c9b687aef3a51966a8162561df1c25d9 Mon Sep 17 00:00:00 2001 From: Joakim Gebart Date: Fri, 10 Jul 2015 12:02:06 +0200 Subject: [PATCH] Makefile.docker: pass command line make variables on the command line --- Makefile.docker | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.docker b/Makefile.docker index 0004ab2b2c..09ac95e06a 100644 --- a/Makefile.docker +++ b/Makefile.docker @@ -70,6 +70,13 @@ DOCKER_ENVIRONMENT_CMDLINE := $(foreach varname,$(DOCKER_ENV_VARS), \ -e '$(varname)=$(subst ','\'',$($(varname)))', \ )) DOCKER_ENVIRONMENT_CMDLINE := $(strip $(DOCKER_ENVIRONMENT_CMDLINE)) +# The variables set on the command line will also be passed on the command line +# in Docker +DOCKER_OVERRIDE_CMDLINE := $(foreach varname,$(DOCKER_ENV_VARS), \ + $(if $(filter command,$(origin $(varname))), \ + '$(varname)=$($(varname))', \ + )) +DOCKER_OVERRIDE_CMDLINE := $(strip $(DOCKER_OVERRIDE_CMDLINE)) # This will execute `make $(DOCKER_MAKECMDGOALS)` inside a Docker container. # We do not push the regular $(MAKECMDGOALS) to the container's make command in @@ -93,4 +100,4 @@ DOCKER_ENVIRONMENT_CMDLINE := $(strip $(DOCKER_ENVIRONMENT_CMDLINE)) -e 'RIOTPROJECT=$(DOCKER_BUILD_ROOT)/riotproject' \ $(DOCKER_ENVIRONMENT_CMDLINE) \ -w '$(DOCKER_BUILD_ROOT)/riotproject/$(BUILDRELPATH)' \ - '$(DOCKER_IMAGE)' make $(DOCKER_MAKECMDGOALS) + '$(DOCKER_IMAGE)' make $(DOCKER_MAKECMDGOALS) $(DOCKER_OVERRIDE_CMDLINE)