-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (45 loc) · 1.14 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
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2019 Manlio Perillo. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Exported variable definitions.
export GO111MODULE := on
# Imported variables: GO_PKG
# Variable definitions.
TESTFLAGS := -race -v
BENCHFLAGS := -v
COVERMODE := atomic # atomic is necessary if the -race flag is enabled
# Standard rules.
.POSIX:
.PHONY: build bench clean cover github install lint print test test-all trace vet
# Default rule.
build:
go build
# Custom rules.
bench:
go test ${BENCHFLAGS} -bench=. -benchmem ./...
clean:
go mod tidy
go clean
go clean -i
rm -f build/*
cover:
go tool cover -html=build/coverage.out -o=build/coverage.html
github:
git push --follow-tags -u github master
install:
go install ./...
lint:
golint ./...
print:
goprint -font='"Inconsolata" 10pt/12pt' ${GO_PKG} > build/pkg.html
prince -o build/pkg.pdf build/pkg.html
test:
go test ${TESTFLAGS} -covermode=${COVERMODE} \
-coverprofile=build/coverage.out \
-trace=build/trace.out ${GO_PKG}
test-all:
go test ${TESTFLAGS} ./...
trace:
go tool trace build/trace.out
vet:
go vet ./...