-
Notifications
You must be signed in to change notification settings - Fork 468
/
Makefile
48 lines (41 loc) · 1.45 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
.DEFAULT_GOAL := help
.PHONY: all build run test clean help mocks
GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run
## This help screen
help:
@printf "Available targets:\n\n"
@awk '/^[a-zA-Z\-\_0-9%:\\]+/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = $$1; \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub("\\\\", "", helpCommand); \
gsub(":+$$", "", helpCommand); \
printf " \x1b[32;01m%-35s\x1b[0m %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST) | sort -u
@printf "\n"
## generate mocks.
mocks:
@echo "Generating mocks"
@ mockgen -package mocks -destination p2p/protocol/mocks/mockedQuaiP2PNode.go -source=p2p/protocol/interface.go QuaiP2PNode
@ mockgen -package mocks -destination common/mocks/mockedStream.go -source=common/mocks/stream.go Stream
## generate protobuf files
protogen:
@echo "Generating protobuf files"
@find . -name '*.proto' -exec protoc --go_out=. --go_opt=paths=source_relative --experimental_allow_proto3_optional {} \;
debug:
go build -gcflags=all="-N -l" -v -o build/bin/go-quai ./cmd/go-quai
## build the go-quai binary
go-quai:
$(GORUN) build/ci.go build ./cmd/go-quai
@echo "Done building."
@echo "Run \"$(GOBIN)/go-quai\" to launch go-quai."
## build the go-quai binary
go-quai-race:
$(GORUN) build/ci.go build -race ./cmd/go-quai
@echo "Done building."
@echo "Run \"$(GOBIN)/go-quai\" to launch go-quai."