-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 974 Bytes
/
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
PROJECT_BINARY=sidepeer
PROJECT_BINARY_OUTPUT=out
PROJECT_RELEASER_OUTPUT=dist
.PHONY: all
all: help
## Build:
tidy: ## Tidy project
go mod tidy -compat=1.17
clean: ## Cleans temporary folder
rm -rf /tmp/peer*
rm -rf ${PROJECT_BINARY_OUTPUT}
rm -rf ${PROJECT_RELEASER_OUTPUT}
build: clean tidy ## Builds project
GO111MODULE=on CGO_ENABLED=0 go build -ldflags="-w -s" -o ${PROJECT_BINARY_OUTPUT}/bin/${PROJECT_BINARY} cmd/${PROJECT_BINARY}/main.go
test: clean tidy ## Run unit tests
go test -v
coverage: clean tidy ## Run code coverage
go test -cover
## GoReleaser:
release-local: clean tidy ## Creates snapshot releases
goreleaser release --snapshot --rm-dist
## Help:
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' make <target>'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " %-20s%s\n", $$1, $$2} \
else if (/^## .*$$/) {printf " %s\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)