Makefile: support overriding CGO_ENABLED

We generally want CGO_ENABLED=0, but cgo is required for odroid.
This change makes the following work:

make manager CGO_ENABLED=1 GOTAGS=odroid
This commit is contained in:
Dmitry Vyukov 2019-10-11 17:10:11 +02:00
parent 1a3bad9041
commit 426631ddb4

View File

@ -40,7 +40,8 @@ GO := go
HOSTGO := go HOSTGO := go
# By default, build all Go binaries as static. We don't need cgo and it is # By default, build all Go binaries as static. We don't need cgo and it is
# known to cause problems at least on Android emulator. # known to cause problems at least on Android emulator.
export CGO_ENABLED=0 CGO_ENABLED ?= 0
export CGO_ENABLED
TARGETGOOS := $(TARGETOS) TARGETGOOS := $(TARGETOS)
TARGETGOARCH := $(TARGETVMARCH) TARGETGOARCH := $(TARGETVMARCH)