1
1
GO ?= go # if using docker, should not need to be installed/linked
2
+ GOAMD64_VERSION ?= v2 # See https://go.dev/wiki/MinimumRequirements#microarchitecture-support
2
3
GOBINREL = build/bin
3
4
GOBIN = $(CURDIR ) /$(GOBINREL )
4
5
UNAME = $(shell uname) # Supported: Darwin, Linux
@@ -34,6 +35,11 @@ ifeq ($(shell uname -s), Darwin)
34
35
endif
35
36
endif
36
37
38
+ # Configure GOAMD64 env.variable for AMD64 architecture:
39
+ ifeq ($(shell uname -m) ,x86_64)
40
+ CPU_ARCH= GOAMD64=${GOAMD64_VERSION}
41
+ endif
42
+
37
43
# about netgo see: https://github.com/golang/go/issues/30310#issuecomment-471669125 and https://github.com/golang/go/issues/57757
38
44
BUILD_TAGS = nosqlite,noboltdb
39
45
@@ -48,9 +54,9 @@ PACKAGE = github.com/erigontech/erigon
48
54
GO_FLAGS += -trimpath -tags $(BUILD_TAGS ) -buildvcs=false
49
55
GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}/params.GitBranch=${GIT_BRANCH} -X ${PACKAGE}/params.GitTag=${GIT_TAG}"
50
56
51
- GOBUILD = CGO_CFLAGS="$(CGO_CFLAGS ) " CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " $(GO ) build $(GO_FLAGS )
52
- GO_DBG_BUILD = CGO_CFLAGS="$(CGO_CFLAGS ) -DMDBX_DEBUG=1" CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " $(GO ) build -tags $(BUILD_TAGS ) ,debug -gcflags=all="-N -l" # see delve docs
53
- GOTEST = CGO_CFLAGS="$(CGO_CFLAGS ) " CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " GODEBUG=cgocheck=0 $(GO ) test $(GO_FLAGS ) ./... -p 2
57
+ GOBUILD = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS ) " CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " $(GO ) build $(GO_FLAGS )
58
+ GO_DBG_BUILD = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS ) -DMDBX_DEBUG=1" CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " $(GO ) build -tags $(BUILD_TAGS ) ,debug -gcflags=all="-N -l" # see delve docs
59
+ GOTEST = ${CPU_ARCH} CGO_CFLAGS="$(CGO_CFLAGS ) " CGO_LDFLAGS="$(CGO_LDFLAGS ) " GOPRIVATE="$(GOPRIVATE ) " GODEBUG=cgocheck=0 $(GO ) test $(GO_FLAGS ) ./... -p 2
54
60
55
61
default : all
56
62
0 commit comments