-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
36 lines (28 loc) · 827 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
fmt:
@echo "==> Running gofmt..."
gofmt -s -w .
build: fmt test
@echo "==> Building library..."
go build -ldflags="-s -w" ./...
@echo "==> Building the CLI..."
go build -ldflags="-s -w" ./cmd/dice
test:
@echo "==> Running tests..."
@go test -cover ./...
report:
@echo "==> Generating report card..."
@goreportcard-cli -v
bench: test
@echo "==> Running benchmarks (may take a while)..."
@go test -run=XXX -bench=. ./...
cover:
@echo "==> Calculating coverage..."
@go test -coverprofile=coverage.out . ./math
@go tool cover -func=coverage.out | grep -vE "^total" | sort -k3,3n
@go tool cover -html=coverage.out
clean:
@rm -f dice dice.exe parser parser.exe coverage.out
godoc:
@echo "==> View godoc at http://localhost:8080/pkg/github.com/travis-g/dice/"
@godoc -http ":8080"
.PHONY: clean build godoc