forked from StationA/tilenol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (24 loc) · 818 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
VERSION := `git describe --tags 2>/dev/null || echo "untagged"`
COMMITISH := `git describe --always 2>/dev/null`
deps:
go mod tidy
go mod verify
format:
go fmt ./...
build: deps
go build -o target/tilenol -ldflags="-X main.Version=${VERSION} -X main.Commitish=${COMMITISH}" ./cmd/...
lint: format
golint github.com/stationa/tilenol
test: build
go test -v -coverprofile=/tmp/tilenol.coverage.out ./...
coverage: test
go tool cover -func=/tmp/tilenol.coverage.out
install: test
go install -ldflags="-X main.Version=${VERSION} -X main.Commitish=${COMMITISH}" ./cmd/...
target:
mkdir -p target
release: test target
CGO_ENABLED=0 go build -a -o target/tilenol -ldflags="-X main.Version=${VERSION} -X main.Commitish=${COMMITISH}" ./cmd/...
clean:
rm -rf target
.PHONY: build test install release clean