-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMakefile
40 lines (30 loc) · 848 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 := walter
VERSION := $(shell grep 'Version string' version.go | sed -E 's/.*"(.+)"$$/\1/')
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X 'main.GitCommit=$(REVISION)'
setup:
go get github.com/Masterminds/glide
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
go get github.com/mitchellh/gox
deps: setup
glide install
test: deps lint
go test $$(glide novendor)
go test -race $$(glide novendor)
lint: setup
go vet $$(glide novendor)
for pkg in $$(glide novendor -x); do \
golint -set_exit_status $$pkg || exit $$?; \
done
fmt: setup
goimports -w $$(glide nv -x)
build: deps
go build -ldflags "$(LDFLAGS)" -o bin/$(NAME)
clean:
rm $(GOPATH)/bin/$(NAME)
rm bin/$(NAME)
package: deps
@sh -c "'$(CURDIR)/scripts/package.sh'"
ghr:
ghr -u walter-cd $(VERSION) pkg/dist/$(VERSION)