Browse code

Fix DOCKER_CROSS being overwritten

Not exactly sure why, but this line;

build: DOCKER_CROSS ?= false

Always overwrote `DOCKER_CROSS` when running `make cross`.
Perhaps because it is set in `cross: DOCKER_CROSS := true`,
and in a different scope? May also be dependent on the
version of `make` in use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/04/14 03:51:34
Showing 1 changed files
... ...
@@ -4,6 +4,9 @@
4 4
 DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
5 5
 export DOCKER_GRAPHDRIVER
6 6
 
7
+# enable/disable cross-compile
8
+DOCKER_CROSS ?= false
9
+
7 10
 # get OS/Arch of docker engine
8 11
 DOCKER_OSARCH := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKER_ENGINE_OSARCH}')
9 12
 DOCKERFILE := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKERFILE}')
... ...
@@ -139,8 +142,6 @@ cross: build ## cross build the binaries for darwin, freebsd and\nwindows
139 139
 
140 140
 ifdef DOCKER_CROSSPLATFORMS
141 141
 build: DOCKER_CROSS := true
142
-else
143
-build: DOCKER_CROSS ?= false
144 142
 endif
145 143
 ifeq ($(BIND_DIR), .)
146 144
 build: DOCKER_BUILD_OPTS += --target=dev