Makefile fixes for Windows
## Motivation
Fixes some minor Windows make issues, this is needed for
## Changes
Runs windows-specific commands when running on Windows, don't run shell commands that cause errors on Windows
## Test Plan
N/A
BINARY := go-spacemesh
-INTERACTIVE := $(shell [ -t 0 ] && echo 1)
VERSION = $(shell cat version.txt)
COMMIT = $(shell git rev-parse HEAD)
SHA = $(shell git rev-parse --short HEAD)
@@ -9,6 +8,15 @@ BIN_DIR = $(CURR_DIR)/build
BIN_DIR_WIN = $(CURR_DIR_WIN)/build
export GO111MODULE = on
+# These commands cause problems on Windows
+ifeq ($(OS),Windows_NT)
+ # Just assume we're in interactive mode on Windows
+ INTERACTIVE = 1
+ VERSION = $(shell type version.txt)
+else
+ INTERACTIVE := $(shell [ -t 0 ] && echo 1)
+endif
+
# Read branch from git if running make manually
# Also allows BRANCH to be manually set
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
