fix build under Cygwin on Windows

This commit is contained in:
Cory Bennett
2016-06-27 15:46:14 -07:00
parent 688b987895
commit 4f91cecf25
+16 -6
View File
@@ -13,14 +13,24 @@ PLATFORMS= \
darwin-amd64 \ darwin-amd64 \
$(NULL) $(NULL)
DIST=$(shell pwd)/dist OS=$(shell uname -s)
ifeq ($(filter CYGWIN%,$(OS)),$(OS))
export CWD=$(shell cygpath -wa .)
export SEP=\\
export CYGWIN=winsymlinks:native
else
export CWD=$(shell pwd)
export SEP=/
endif
export GOPATH=$(shell pwd) export GOPATH=$(CWD)
GOBIN ?= $(shell pwd) DIST=$(CWD)$(SEP)dist
GOBIN ?= $(CWD)
NAME=jira NAME=jira
BIN ?= $(GOBIN)/$(NAME) BIN ?= $(GOBIN)$(SEP)$(NAME)
CURVER ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}') CURVER ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}')
LDFLAGS:=-X jira.VERSION=$(patsubst v%,%,$(CURVER)) -w LDFLAGS:=-X jira.VERSION=$(patsubst v%,%,$(CURVER)) -w
@@ -34,11 +44,11 @@ else
endif endif
build: src/github.com/Netflix-Skunkworks/go-jira build: src/github.com/Netflix-Skunkworks/go-jira
$(GOBUILD) -o $(BIN) main/main.go $(GOBUILD) -o '$(BIN)' main/main.go
src/%: src/%:
mkdir -p $(@D) mkdir -p $(@D)
test -L $@ || ln -sf ../../.. $@ test -L $@ || ln -sf '$(GOPATH)' $@
go get -v $* $*/main go get -v $* $*/main
cross-setup: cross-setup: