-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
34 lines (25 loc) · 1.04 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
# This creates a binary executable file, src/hri, which creates a web server.
# Also '//go:build !tests' must be at the beginning of the file, so it is excluded from tests.
# While the other functions are still in an unconverted state, they will also contain an // +build ignore which prevents the compiler from complaining about there being several definitions of func main().
HRI:=./src/hri
SRCS:=$(find src -name *.go)
TEST:=./src/testCoverage.out
$(HRI): clean format tidy $(TEST) src/go.mod src/go.sum $(SRCS)
cd src; go build -o hri
test: clean $(TEST)
# '-tags tests' is used to excluded the multiple main declarations from test builds
$(TEST): $(SRCS) src/go.mod src/go.sum
cd src; go test -coverprofile testCoverage.out ./... -v -tags tests
coverage:
cd src; go tool cover -html=testCoverage.out
format:
cd src; go fmt ./...
tidy:
cd src; go mod tidy
deps:
cd src; go list -m all
clean:
-rm ./src/hri
-rm ./src/testCoverage.out
# targets that don't produce physical files and get run every time
.PHONY: coverage clean format tidy deps