summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@idaemons.org>2018-04-12 17:09:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2018-04-12 17:09:08 +0900
commitd207672bd57bdc0c7a410e2d81c993675e2df59c (patch)
treeae7eceaf7cd29498de4445eb5874b9bd1652ac60 /Makefile
parent851fa382519edc10a887d893abf54af3588c8de2 (diff)
Parse the output of `go version` to get the value of GOOS (#1260)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 1 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 5c15f69d..22992170 100644
--- a/Makefile
+++ b/Makefile
@@ -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)))