provide Windows-compatible commands for make targets

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/5272/head
Matthew Fisher 7 years ago
parent 087d1eab52
commit 610dbeae7a
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -1,28 +1,40 @@
BINDIR := $(CURDIR)/bin PROJECTNAME = helm
DIST_DIRS := find * -type d -exec
TARGETS := darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64
BINNAME ?= helm
GOPATH = $(shell go env GOPATH) # Required for globs to work correctly
DEP = $(GOPATH)/bin/dep SHELL = /bin/bash
GOX = $(GOPATH)/bin/gox CHECK = which
NUL = /dev/null
BINNAME = $(PROJECTNAME)
# go option # go option
PKG := ./... PKG := ./...
TAGS := TAGS :=
TESTS := . TESTS := .
TESTFLAGS := TESTFLAGS :=
LDFLAGS := -w -s LDFLAGS := -w -s
GOFLAGS := GOFLAGS :=
SRC := $(shell find . -type f -name '*.go' -print) SRC = $(shell find . -type f -name '*.go' -print)
# Required for globs to work correctly GIT_COMMIT = $(shell git rev-parse HEAD)
SHELL = /bin/bash GIT_SHA = $(shell git rev-parse --short HEAD)
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>$(NUL))
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
BINDIR := $(CURDIR)/bin
DIST_DIRS := find * -type d -exec
TARGETS := darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64
ifeq ($(OS),Windows_NT)
BINNAME = $(PROJECTNAME).exe
SHELL = cmd.exe
CHECK = where.exe
NUL = NUL
SRC = $(shell dir /B /S /A:-D . *.go)
GIT_DIRTY = $(shell powershell "if (-not ([string]::IsNullOrEmpty((git status --porcelain)))) { echo dirty } else { echo clean }")
endif
GIT_COMMIT = $(shell git rev-parse HEAD) DEP = $(shell $(CHECK) dep)
GIT_SHA = $(shell git rev-parse --short HEAD) GOX = $(shell $(CHECK) gox)
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
ifdef VERSION ifdef VERSION
BINARY_VERSION = $(VERSION) BINARY_VERSION = $(VERSION)

Loading…
Cancel
Save