-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathMakefile
55 lines (39 loc) · 1.16 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
GOPATH=$(CURDIR)/vendor:$(CURDIR)
GOBIN=$(CURDIR)/vendor/bin
GB=$(CURDIR)/vendor/bin/gb
VERSION = 0.0.2
all: bake-config skizze skizze-cli
bake-config:
@GOPATH=$(GOPATH) \
go generate src/config/config.go > src/config/config.go.tmp
@mv src/config/config.go.tmp src/config/config.go
skizze:
@GOPATH=$(GOPATH) \
go build -a -v -ldflags "-w -X main.version=${VERSION}" \
-o ./bin/skizze ./src/skizze
skizze-cli:
@GOPATH=$(GOPATH) \
go build -a -v -ldflags "-w -X skizze-cli/bridge.version=${VERSION}" \
-o ./bin/skizze-cli ./src/skizze-cli
build-dep:
@GOBIN=$(GOBIN) go get github.com/constabulary/gb/...
vendor:
@$(GB) vendor restore
test:
@GOPATH=$(GOPATH) go test -race -cover ./src/...
bench:
@GOPATH=$(GOPATH) go test -bench=. ./src/...
proto:
@protoc --go_out=plugins=grpc:. ./src/datamodel/protobuf/skizze.proto
dist: build-dep vendor all
setup-lint:
@GOPATH=$(GOPATH) && \
go get github.com/alecthomas/gometalinter
@GOPATH=$(GOPATH) && \
gometalinter --install --update
lint:
@GOPATH=$(GOPATH) && \
gometalinter ./src/* -D gocyclo -D gotype -D dupl --deadline=120s
clean:
@rm ./bin/*
.PHONY: all build-dep vendor test dist clean