forked from informalsystems/tm-load-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (29 loc) · 1.17 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
GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= ./build
.PHONY: build build-tm-load-test build-tm-outage-sim-server \
build-linux build-tm-load-test-linux build-tm-outage-sim-server-linux \
test lint clean
.DEFAULT_GOAL := build
BUILD_FLAGS ?= -mod=readonly
build: build-tm-load-test build-tm-outage-sim-server
build-tm-load-test:
@go build $(BUILD_FLAGS) \
-ldflags "-X github.com/informalsystems/tm-load-test/pkg/loadtest.cliVersionCommitID=`git rev-parse --short HEAD`" \
-o $(BUILD_DIR)/tm-load-test ./cmd/tm-load-test/main.go
build-tm-outage-sim-server:
@go build $(BUILD_FLAGS) -o $(BUILD_DIR)/tm-outage-sim-server ./cmd/tm-outage-sim-server/main.go
build-linux: build-tm-load-test-linux build-tm-outage-sim-server-linux
build-tm-load-test-linux:
GOOS=linux GOARCH=amd64 $(MAKE) build-tm-load-test
build-tm-outage-sim-server-linux:
GOOS=linux GOARCH=amd64 $(MAKE) build-tm-outage-sim-server
test:
go test -cover -race ./...
bench:
go test -bench="Benchmark" -run="notests" ./...
$(GOPATH)/bin/golangci-lint:
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
lint: $(GOPATH)/bin/golangci-lint
$(GOPATH)/bin/golangci-lint run ./...
clean:
rm -rf $(BUILD_DIR)