Parse the output of go version to get the value of GOOS (#1260)

This commit is contained in:
Akinori MUSHA 2018-04-12 17:09:08 +09:00 committed by Junegunn Choi
parent 851fa38251
commit d207672bd5

View File

@ -1,12 +1,5 @@
ifndef GOOS
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
GOOS := darwin
else ifeq ($(UNAME_S),Linux)
GOOS := linux
else
$(error "$$GOOS is not defined.")
endif
GOOS := $(word 1, $(subst /, " ", $(word 4, $(shell go version))))
endif
MAKEFILE := $(realpath $(lastword $(MAKEFILE_LIST)))