Skip to content

Commit 5ca2820

Browse files
Merge pull request containers#4198 from nalind/makefile-go
Makefile: always call $(GO) instead of `go`
2 parents 724ef7c + 811741f commit 5ca2820

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ BUILDAH := buildah
1414
GO := go
1515
GO_LDFLAGS := $(shell if $(GO) version|grep -q gccgo; then echo "-gccgoflags"; else echo "-ldflags"; fi)
1616
GO_GCFLAGS := $(shell if $(GO) version|grep -q gccgo; then echo "-gccgoflags"; else echo "-gcflags"; fi)
17-
GO110 := 1.10
18-
GOVERSION := $(findstring $(GO110),$(shell go version))
1917
# test for go module support
20-
ifeq ($(shell go help mod >/dev/null 2>&1 && echo true), true)
18+
ifeq ($(shell $(GO) help mod >/dev/null 2>&1 && echo true), true)
2119
export GO_BUILD=GO111MODULE=on $(GO) build -mod=vendor
2220
export GO_TEST=GO111MODULE=on $(GO) test -mod=vendor
2321
else
@@ -31,9 +29,12 @@ GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),${COMMIT
3129
SOURCE_DATE_EPOCH ?= $(if $(shell date +%s),$(shell date +%s),$(error "date failed"))
3230
STATIC_STORAGETAGS = "containers_image_openpgp exclude_graphdriver_devicemapper $(STORAGE_TAGS)"
3331

34-
CNI_COMMIT := $(shell sed -n 's;\tgithub.com/containernetworking/cni \([^ \n]*\).*$\;\1;p' go.mod)
35-
#RUNC_COMMIT := $(shell sed -n 's;\tgithub.com/opencontainers/runc \([^ \n]*\).*$\;\1;p' go.mod)
36-
RUNC_COMMIT := v1.0.0-rc8
32+
# we get GNU make 3.x in MacOS build envs, which wants # to be escaped in
33+
# strings, while the 4.x we have on Linux doesn't. this is the documented
34+
# workaround
35+
COMMENT := \#
36+
CNI_COMMIT := $(shell sed -n 's;^$(COMMENT) github.com/containernetworking/cni \([^ \n]*\).*$$;\1;p' vendor/modules.txt)
37+
RUNC_COMMIT := $(shell sed -n 's;^$(COMMENT) github.com/opencontainers/runc \([^ \n]*\).*$$;\1;p' vendor/modules.txt)
3738
LIBSECCOMP_COMMIT := release-2.3
3839

3940
EXTRA_LDFLAGS ?=

0 commit comments

Comments
 (0)