Breaking Makefile into platform specific files

Fixed #1270

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
This commit is contained in:
Kunal Kushwaha
2017-08-17 16:13:35 +09:00
parent 89da512692
commit 1c989588c0
7 changed files with 54 additions and 22 deletions

19
Makefile.OS Normal file
View File

@@ -0,0 +1,19 @@
#Detect the OS, and return installos value same as GOOS
target_os =
ifeq ($(OS),Windows_NT)
target_os = windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
target_os = linux
endif
ifeq ($(UNAME_S),Darwin)
target_os = darwin
endif
ifeq ($(UNAME_S),FreeBSD)
target_os = freebsd
endif
ifeq ($(UNAME_S),SunOS)
target_os = solaris
endif
endif