From ac28fee30494bc20fa6c293263fdd93572138d32 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 12 Apr 2017 14:47:38 -0400 Subject: [PATCH] Makefile: fix `sudo make install` When there isn't a `go` outside of the user's PATH Signed-off-by: Vincent Batts --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index d8a19415f..fc47caceb 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,11 @@ VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always) PKG=github.com/containerd/containerd +ifneq "$(strip $(shell command -v go 2>/dev/null))" "" GOOS ?= $(shell go env GOOS) +else +GOOS ?= $$GOOS +endif WHALE = "🐳" ONI = "👹" ifeq ("$(OS)", "Windows_NT")