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>
This commit is contained in:
Sebastiaan van Stijn 2019-04-13 20:51:34 +02:00
parent a85a64e3b4
commit 934b3a3841
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -4,6 +4,9 @@
DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
export DOCKER_GRAPHDRIVER
# enable/disable cross-compile
DOCKER_CROSS ?= false
# get OS/Arch of docker engine
DOCKER_OSARCH := $(shell bash -c 'source hack/make/.detect-daemon-osarch && echo $${DOCKER_ENGINE_OSARCH}')
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
ifdef DOCKER_CROSSPLATFORMS
build: DOCKER_CROSS := true
else
build: DOCKER_CROSS ?= false
endif
ifeq ($(BIND_DIR), .)
build: DOCKER_BUILD_OPTS += --target=dev