forked from imkira/gcp-iap-auth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (24 loc) · 843 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
GIT_BRANCHTAG=$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
GIT_COMMIT=$(shell git rev-parse HEAD)
GOOS?=linux
GOARCH?=amd64
GOBUILD_ENV+=CGO_ENABLED=0
GOBUILD_FLAGS+=-a -ldflags "$(GOBUILD_LDFLAGS)"
GOBUILD_LDFLAGS+=-X \"main.version=$(GIT_BRANCHTAG)\"
GOBUILD_LDFLAGS+=-X \"main.revision=$(GIT_COMMIT)\"
GOBUILD_LDFLAGS+=-s -w
DIST_OUTPUT=gcp-iap-auth-$(GOOS)-$(GOARCH)
SHASUM=shasum -a 1
.PHONY: all build dist clean deps vendor
all: build
build:
go build -o "build/gcp-iap-auth"
dist:
GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD_ENV) go build $(GOBUILD_FLAGS) -o "dist/$(DIST_OUTPUT)"
cd dist && $(SHASUM) "$(DIST_OUTPUT)" > "$(DIST_OUTPUT).sha1"
clean:
rm -rf build dist
deps:
[ ! -d "${GOPATH}/src/github.com/Masterminds/glide" ] && go get -u github.com/Masterminds/glide
vendor:
glide up -v