-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (41 loc) · 1.15 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
# VARIABLES
# -
# ENVIRONMENT VARIABLES
export GO111MODULE=on
# CONFIG
.PHONY: help print-variables
.DEFAULT_GOAL = help
# ACTIONS
## code
build : ## Build package
go build ./...
mod-down : ## Download go modules references
go mod download
mod-tidy : ## Tidy go modules references
go mod tidy
test: ## Run all tests
go test -coverprofile=coverage.out -count=5 -race ./...
## release
simulate-release: ## Simulate a library release
goreleaser --snapshot --skip-publish --rm-dist
release: ## Release library
goreleaser release --rm-dist
## helpers
available-exchange : ## Print available exchanges
echo $(AVAILABLE_EXCHANGES)
help : ## Help
@echo ""
@echo "*** \033[33mMakefile help\033[0m ***"
@echo ""
@echo "Targets list:"
@grep -E '^[a-zA-Z_-]+ :.*?## .*$$' $(MAKEFILE_LIST) | sort -k 1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\t\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo ""
print-variables : ## Print variables values
@echo ""
@echo "*** \033[33mMakefile variables\033[0m ***"
@echo ""
@echo "- - - makefile - - -"
@echo "MAKE: $(MAKE)"
@echo "MAKEFILES: $(MAKEFILES)"
@echo "MAKEFILE_LIST: $(MAKEFILE_LIST)"
@echo ""