minimal_golang_version_check (#1752)

This commit is contained in:
Alex Sharov 2021-04-19 17:54:56 +07:00 committed by GitHub
parent e44b5eb84e
commit 93a57f46a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,9 @@ GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GOBUILD = env GO111MODULE=on go build -trimpath -tags "mdbx" -ldflags "-X main.gitCommit=${GIT_COMMIT} -X main.gitBranch=${GIT_BRANCH}"
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
OS = $(shell uname -s)
ARCH = $(shell uname -m)
@ -17,6 +20,12 @@ endif
all: tg hack rpctest state pics rpcdaemon integration db-tools
go-version:
@if [ $(GO_MINOR_VERSION) -lt 16 ]; then \
echo "minimum required Golang version is 1.16"; \
exit 1 ;\
fi
docker:
docker build -t turbo-geth:latest --build-arg git_commit='${GIT_COMMIT}' --build-arg git_branch='${GIT_BRANCH}' .
@ -28,7 +37,7 @@ geth:
@echo "Done building."
@echo "Run \"$(GOBIN)/tg\" to launch turbo-geth."
tg: mdbx
tg: go-version mdbx
@echo "Building tg"
$(GOBUILD) -o $(GOBIN)/tg ./cmd/tg
@echo "Done building."