forked from Versent/saml2aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (32 loc) · 957 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
35
36
37
38
39
NAME=saml2aws
ARCH=$(shell uname -m)
VERSION=1.3.1
ITERATION := 1
default: deps compile
deps:
go get github.com/c4milo/github-release
go get github.com/mitchellh/gox
glide install
compile: deps
@rm -rf build/
@gox -ldflags "-X main.Version=$(VERSION)" \
-osarch="darwin/amd64" \
-osarch="linux/i386" \
-osarch="linux/amd64" \
-osarch="windows/amd64" \
-osarch="windows/i386" \
-output "build/{{.Dir}}_$(VERSION)_{{.OS}}_{{.Arch}}/$(NAME)" \
$(shell glide novendor)
dist:
$(eval FILES := $(shell ls build))
@rm -rf dist && mkdir dist
@for f in $(FILES); do \
(cd $(shell pwd)/build/$$f && tar -cvzf ../../dist/$$f.tar.gz *); \
(cd $(shell pwd)/dist && shasum -a 512 $$f.tar.gz > $$f.sha512); \
echo $$f; \
done
release:
@github-release "v$(VERSION)" dist/* --commit "$(git rev-parse HEAD)" --github-repository versent/$(NAME)
test: deps
go test -cover -v $(shell glide novendor)
.PHONY: default deps compile dist release test