-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (32 loc) · 870 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
# Default installation path
INSTALL_PATH ?= $(HOME)/go/bin
#? build: Build the project and create ec-debug binary
build: rpc
go build -buildvcs=false -o ec-debug
#? rpc: Generate RPC code using buf
rpc:
buf generate
#? install: Install the binary to $(HOME)/go/bin as ec
install: build
mv ec-debug ec
mkdir -p $(INSTALL_PATH)
mv ec $(INSTALL_PATH)
#? test: Run tests with verbose output
test:
go test ./... -v
#? lint: Run golangci-lint
lint:
golangci-lint run -v
#? fmt: Format the code
fmt:
go fmt ./...
#? clean: Clean build caches and binaries
clean:
go clean -cache -testcache -modcache
rm -f ec-debug
#? all: Run all targets
all: clean fmt rpc build test lint
#? help: List all available make targets with their descriptions
help: Makefile
@$(call print, "Listing commands:")
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'