forked from chengshiwen/influx-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (29 loc) · 1.03 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
### Makefile ---
## Author: Shell.Xu
## Version: $Id: Makefile,v 0.0 2017/01/17 03:44:24 shell Exp $
## Copyright: 2017, Eleme <[email protected]>, BizSeer <[email protected]>
## License: MIT
## Keywords:
## X-URL:
export GO_BUILD=GO111MODULE=on CGO_ENABLED=0 go build -o bin/influx-proxy -ldflags "-s -w -X main.GitCommit=$(shell git rev-parse --short HEAD) -X 'main.BuildTime=$(shell date '+%Y-%m-%d %H:%M:%S')'"
.PHONY: build linux test bench run lint down tidy clean
all: build
build: lint
$(GO_BUILD)
linux: lint
GOOS=linux GOARCH=amd64 $(GO_BUILD)
test:
go test -v github.com/chengshiwen/influx-proxy/backend
bench:
go test -bench=. -run=none github.com/chengshiwen/influx-proxy/backend
run:
go run main.go
lint:
golangci-lint run --enable=golint --disable=errcheck --disable=typecheck && goimports -l -w . && go fmt ./... && go vet ./...
down:
go list ./... && go mod verify
tidy:
head -n 3 go.mod > go.mod.tmp && mv go.mod.tmp go.mod && rm -f go.sum && go mod tidy -v
clean:
rm -rf bin data log
### Makefile ends here