From e735faac7569597f2edf0ef1c97d92f50a2edd27 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 25 Sep 2017 16:37:15 -0400 Subject: [PATCH] use Makefile var for go compiler This will allow compilation with a custom go binary, for example /usr/lib/go-1.8/bin/go instead of /usr/bin/go on Ubuntu 16.04 which is still version 1.6 Signed-off-by: Lokesh Mandvekar --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f0afd3e1..af19a7b8 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ REGISTRIESDDIR=${CONTAINERSSYSCONFIGDIR}/registries.d SIGSTOREDIR=${DESTDIR}/var/lib/atomic/sigstore BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions GO_MD2MAN ?= go-md2man +GO ?= go ifeq ($(DEBUG), 1) override GOGCFLAGS += -N -l @@ -63,10 +64,10 @@ binary-static: cmd/skopeo # Build w/o using Docker containers binary-local: - go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo + $(GO) build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo binary-local-static: - go build -ldflags "-extldflags \"-static\" -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo + $(GO) build -ldflags "-extldflags \"-static\" -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o skopeo ./cmd/skopeo build-container: docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" . @@ -122,4 +123,4 @@ validate-local: hack/make.sh validate-git-marks validate-gofmt validate-lint validate-vet test-unit-local: - go test -tags "$(BUILDTAGS)" $$(go list -tags "$(BUILDTAGS)" -e ./... | grep -v '^github\.com/projectatomic/skopeo/\(integration\|vendor/.*\)$$') + $(GO) test -tags "$(BUILDTAGS)" $$($(GO) list -tags "$(BUILDTAGS)" -e ./... | grep -v '^github\.com/projectatomic/skopeo/\(integration\|vendor/.*\)$$')