forked from NethermindEth/juno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (36 loc) · 1.18 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
export CC = clang
.DEFAULT_GOAL := help
juno: ## compile
@mkdir -p build
@go build -o build/juno ./cmd/juno/
all: juno
generate: ## generate
@cd internal/db && $(MAKE) generate
@cd pkg/felt && go generate ./...
clean-testcache:
go clean -testcache
test: clean-testcache ## tests
go test ./...
test-race: clean-testcache
go test ./... -race
benchmarks: ## benchmarking
go test ./... -run=^# -bench=. -benchmem
test-cover: ## tests with coverage
mkdir -p coverage
go test -coverpkg=./... -coverprofile=coverage/coverage.out -covermode=atomic ./...
go tool cover -html=coverage/coverage.out -o coverage/coverage.html
install-deps: | install-gofumpt ## install some project dependencies
install-gofumpt:
# install gofumpt
go install mvdan.cc/gofumpt@latest
tidy: ## add missing and remove unused modules
go mod tidy
format: ## run go formatter
gofumpt -l -w .
format-check: ## check formatting
# assert `gofumpt -l` produces no output
test ! $$(gofumpt -l . | tee /dev/stderr)
clean: ## clean project builds
@rm -rf ./build
help: ## show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'