Add a check in the makefile to ensure a minimum version of go is installed (#383)
This commit is contained in:
parent
b6234abfb3
commit
29c5f31f90
10
Makefile
10
Makefile
|
@ -1,8 +1,16 @@
|
||||||
|
GOMINVERSION = 1.16
|
||||||
NEBULA_CMD_PATH = "./cmd/nebula"
|
NEBULA_CMD_PATH = "./cmd/nebula"
|
||||||
BUILD_NUMBER ?= dev+$(shell date -u '+%Y%m%d%H%M%S')
|
BUILD_NUMBER ?= dev+$(shell date -u '+%Y%m%d%H%M%S')
|
||||||
GO111MODULE = on
|
GO111MODULE = on
|
||||||
export GO111MODULE
|
export GO111MODULE
|
||||||
|
|
||||||
|
# Ensure the version of go we are using is at least what is defined in GOMINVERSION at the top of this file
|
||||||
|
GOVERSION := $(shell go version | awk '{print substr($$3, 3)}')
|
||||||
|
GOISMIN := $(shell expr "$(GOVERSION)" ">=" "$(GOMINVERSION)")
|
||||||
|
ifneq "$(GOISMIN)" "1"
|
||||||
|
$(error "go version $(GOVERSION) is not supported, upgrade to $(GOMINVERSION) or above")
|
||||||
|
endif
|
||||||
|
|
||||||
LDFLAGS = -X main.Build=$(BUILD_NUMBER)
|
LDFLAGS = -X main.Build=$(BUILD_NUMBER)
|
||||||
|
|
||||||
ALL_LINUX = linux-amd64 \
|
ALL_LINUX = linux-amd64 \
|
||||||
|
@ -24,6 +32,8 @@ ALL = $(ALL_LINUX) \
|
||||||
freebsd-amd64 \
|
freebsd-amd64 \
|
||||||
windows-amd64
|
windows-amd64
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
all: $(ALL:%=build/%/nebula) $(ALL:%=build/%/nebula-cert)
|
all: $(ALL:%=build/%/nebula) $(ALL:%=build/%/nebula-cert)
|
||||||
|
|
||||||
release: $(ALL:%=build/nebula-%.tar.gz)
|
release: $(ALL:%=build/nebula-%.tar.gz)
|
||||||
|
|
Loading…
Reference in New Issue