-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.35 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
.PHONY: build
build: deps
go build -o ./bin/tmrpc -mod=readonly ./cmd/tmrpc
.PHONY: install
install: deps
go install ./cmd/tmrpc
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
# Uncomment when you have some tests
# test:
# @go test -mod=readonly $(PACKAGES)
.PHONY: lint
# look into .golangci.yml for enabling / disabling linters
lint:
@echo "--> Running linter"
@golangci-lint run
@go mod verify
# Run all the code generators in the project
.PHONY: generate
generate: go.sum prereqs goimports
go generate ./...
.PHONY: goimports
goimports:
@echo "running goimports"
# exclude mocks and proto generated files
@goimports -l -local github.com/axelarnetwork/ . | grep -v mock | xargs goimports -local github.com/axelarnetwork/ -w
# Install all generate prerequisites
.Phony: prereqs
prereqs:
@which goimports &>/dev/null || go install golang.org/x/tools/cmd/goimports
@which moq &>/dev/null || go install github.com/matryer/moq
@which mdformat &>/dev/null || pip3 install mdformat
# Prepare go deps, as well as zeromq
.PHONY: deps
deps: go.sum
@echo "--> Ensure build dependencies are present in the system"
go mod tidy
@echo 'checking zeromq dependencies'; sh -c 'pkg-config --modversion libzmq'
# Build a release image
.PHONY: docker-image
docker-image:
@DOCKER_BUILDKIT=1 docker build -t axelar/tmrpc .