-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (58 loc) · 2.01 KB
/
Makefile
File metadata and controls
75 lines (58 loc) · 2.01 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SHELL := /bin/sh
.SILENT:
#####################
### General ###
#####################
.PHONY: help
.DEFAULT_GOAL := help
help: ## Prints all the targets in all the Makefiles
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: list
list: ## List all make targets
@${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort
#####################
### Documentation ###
#####################
## Ensure godoc is installed
.PHONY:
# Internal helper target - check if godoc is installed
check_godoc:
{ \
if ( ! ( command -v godoc >/dev/null )); then \
echo "Seems like you don't have godoc installed. Make sure you install it via 'go install golang.org/x/tools/cmd/godoc@latest' before continuing"; \
exit 1; \
fi; \
}
#####################
#### Testing ####
#####################
.PHONY: test_all
test_all: ## runs the test suite
go test -v -p 1 -count=1 ./... -mod=readonly -race
.PHONY: test_badger
test_badger: ## runs the badger KVStore submodule's test suite
go test -v -p 1 -count=1 ./kvstore/badger/... -mod=readonly -race
.PHONY: test_pebble
test_pebble: ## runs the pebble KVStore submodule's test suite
go test -v -p 1 -count=1 ./kvstore/pebble/... -mod=readonly -race
#####################
### go helpers ###
#####################
.PHONY: mod_tidy
mod_tidy: ## runs go mod tidy for all (sub)modules
go mod tidy
cd kvstore/simplemap && go mod tidy
cd kvstore/badger && go mod tidy
.PHONY: go_docs
go_docs: check_godoc ## Generate documentation for the project
echo "Visit http://localhost:6060/pkg/github.com/pokt-network/smt/"
godoc -http=:6060
.PHONY: go_lint
go_lint: ## Run all go linters
golangci-lint run --timeout 5m --build-tags test
###############
### Imports ###
###############
include ./makefiles/colors.mk
include ./makefiles/release.mk
include ./makefiles/benchmarks.mk