-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
63 lines (45 loc) · 1.46 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
55
56
57
58
59
60
61
62
63
all: client server
BUILD_FLAGS = -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build'
getdeps:
@echo "Installing golint" && go get -u golang.org/x/lint/golint
@echo "Installing gocyclo" && go get -u github.com/fzipp/gocyclo
@echo "Installing deadcode" && go get -u github.com/remyoudompheng/go-misc/deadcode
@echo "Installing misspell" && go get -u github.com/client9/misspell/cmd/misspell
@echo "Installing ineffassign" && go get -u github.com/gordonklaus/ineffassign
verifiers: vet fmt lint cyclo spelling static #deadcode
vet:
@echo "Running $@"
@go vet -atomic -bool -copylocks -nilfunc -printf -rangeloops -unreachable -unsafeptr -unusedresult ./...
fmt:
@echo "Running $@"
@gofmt -d .
lint:
@echo "Running $@"
golint -set_exit_status $(shell go list ./... | grep -v stubs)
ineffassign:
@echo "Running $@"
ineffassign .
cyclo:
@echo "Running $@"
gocyclo -over 100 .
deadcode:
@echo "Running $@"
deadcode -test $(shell go list ./...) || true
spelling:
misspell -i monitord -error `find .`
static:
go run honnef.co/go/tools/cmd/staticcheck -- ./...
# Builds minio, runs the verifiers then runs the tests.
check: test
test: verifiers build
go test -v ./...
build: server client
server:
mkdir -p bin
cd cmds/server && go build $(BUILD_FLAGS) -o ../../bin/trs
client:
mkdir -p bin
cd cmds/client && go build $(BUILD_FLAGS) -o ../../bin/trc
runserver: server
sudo bin/trs -config router.toml
.PHONY: server client