-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
35 lines (28 loc) · 798 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
COMMIT := $(shell git rev-parse --short HEAD)
all: clean deps proto test build
deps:
go mod download
build:
go build -race -ldflags "-s -w -X main.Version=DEV-SNAPSHOT -X main.Commit=$(COMMIT)" -o dist/intercert github.com/evenh/intercert
proto:
@ if ! which protoc > /dev/null; then \
echo "error: protoc not installed" >&2; \
exit 1; \
fi
go get -u -v github.com/golang/protobuf/protoc-gen-go
for file in $$(git ls-files '*.proto'); do \
protoc -I $$(dirname $$file) --go_out=plugins=grpc:$$(dirname $$file) $$file; \
done
test:
go test -v -race -coverprofile=coverage.txt -covermode=atomic -cpu 1,4 github.com/evenh/intercert/...
clean:
rm -rf ./dist
rm -f coverage.txt
go clean -i github.com/evenh/intercert/...
.PHONY: \
all \
deps \
build \
proto \
test \
clean