diff options
author | Akinori MUSHA <knu@idaemons.org> | 2018-04-12 17:09:08 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2018-04-12 17:09:08 +0900 |
commit | d207672bd57bdc0c7a410e2d81c993675e2df59c (patch) | |
tree | ae7eceaf7cd29498de4445eb5874b9bd1652ac60 | |
parent | 851fa382519edc10a887d893abf54af3588c8de2 (diff) |
Parse the output of `go version` to get the value of GOOS (#1260)
-rw-r--r-- | Makefile | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -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))) |