-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
60 lines (45 loc) · 1.61 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
GOPATH?=$(shell go env GOPATH)
GOBIN?=$(GOPATH)/bin
SRC_DIR?=$(GOPATH)/src/github.com/tendermint/networks
BUILD_DIR?=$(SRC_DIR)/build
.PHONY: build-tm-outage-sim-server build-tm-outage-sim-server-linux \
tools tools-linux \
clean test lint \
get-deps \
protos
$(GOBIN)/dep:
go get -u github.com/golang/dep/cmd/dep
$(GOBIN)/golangci-lint:
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
get-deps: $(GOBIN)/dep
dep ensure
get-linter: $(GOBIN)/golangci-lint
build-tm-outage-sim-server: get-deps
go build -o $(BUILD_DIR)/tm-outage-sim-server \
$(SRC_DIR)/cmd/tm-outage-sim-server/main.go
build-tm-outage-sim-server-linux: get-deps
GOOS=linux GOARCH=amd64 \
go build -o $(BUILD_DIR)/tm-outage-sim-server \
$(SRC_DIR)/cmd/tm-outage-sim-server/main.go
build-tm-load-test: get-deps
go build -o $(BUILD_DIR)/tm-load-test \
$(SRC_DIR)/cmd/tm-load-test/main.go
build-tm-load-test-linux: get-deps
GOOS=linux GOARCH=amd64 \
go build -o $(BUILD_DIR)/tm-load-test \
$(SRC_DIR)/cmd/tm-load-test/main.go
tools: build-tm-outage-sim-server build-tm-load-test
tools-linux: build-tm-outage-sim-server-linux build-tm-load-test-linux
protos: $(GOPATH)/bin/protoc-gen-gogoslick
protoc --gogoslick_out=$(SRC_DIR)/pkg/loadtest/messages/ \
-I$(GOPATH)/src/github.com/tendermint/networks/pkg/loadtest/messages/ \
-I$(GOPATH)/src/github.com/tendermint/networks/vendor/ \
loadtest.proto
$(GOPATH)/bin/protoc-gen-gogoslick:
go get -u github.com/gogo/protobuf/...
lint: get-deps get-linter
golangci-lint run ./...
test: get-deps
go list ./... | grep -v /vendor/ | xargs go test -cover -race
clean:
rm -rf $(BUILD_DIR)