-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
46 lines (34 loc) · 946 Bytes
/
GNUmakefile
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
.PHONY: build install test fmt coverage dep-init dep-ensure dep-graph pre-commit install-pre-CMD
CMD_DIR := cmd/reinc
build:
go build -v -ldflags "-s -w"
$(MAKE) -C $(CMD_DIR) build
install:
go install -v -ldflags "-s -w"
$(MAKE) -C $(CMD_DIR) install
test:
go test ./...
fmt:
find . -name '*.go' | grep -v ./vendor/ | xargs gofmt -w
coverage:
mkdir -p test/coverage
go test -coverprofile=test/coverage/cover.out ./...
go tool cover -html=test/coverage/cover.out -o test/coverage/cover.html
dep-init:
-rm -rf vendor/
-rm -f Gopkg.toml Gopkg.lock
dep init
dep-ensure:
dep ensure
dep-graph: images/dependency.png
images/dependency.png: Gopkg.lock
mkdir -p images
dep status -dot | grep -v '^The status of ' | dot -Tpng -o images/dependency.png
pre-commit:
$(MAKE) dep-ensure
$(MAKE) fmt
$(MAKE) build
$(MAKE) coverage
install-pre-commit:
echo 'make pre-commit' >.git/hooks/pre-commit
chmod +x .git/hooks/pre-commit