-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 839 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
VERSION_FLAG := main.version=$(shell git describe --tags --abbrev=0)
DIST_FOLDER := dist
.PHONY: githooks
githooks:
cp -f githooks/* .git/hooks/
.PHONY: install
install: githooks
go get -u github.com/alecthomas/gometalinter
gometalinter --install
go get -u github.com/mitchellh/gox
go get -u github.com/xeipuuv/gojsonschema
go get -u github.com/mgutz/ansi
go install ./...
.PHONY: lint
lint:
gometalinter ./... --enable-all --line-length=100 --vendor --sort=path --sort=line --sort=column --deadline=5m -t
.PHONY: clean
clean:
rm -rf ${DIST_FOLDER}
.PHONY: build
build: clean
gox -ldflags "-X ${VERSION_FLAG}" -os="linux darwin windows" -arch="386 amd64" -output="${DIST_FOLDER}/{{.Dir}}_{{.OS}}_{{if eq .Arch \"386\"}}i386{{else}}{{.Arch}}{{end}}" ./...
.PHONY: run
run:
go run -ldflags "-X ${VERSION_FLAG}" *.go ${ARGS}