-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 1017 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 1017 Bytes
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
VERSION := $(shell grep 'Version =' internal/buildinfo/version.go | cut -d'"' -f2)
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
GOVERSION := $(shell go version | awk '{print $$3}')
LDFLAGS := -s -w \
-X github.com/toasterbook88/axis/internal/buildinfo.Commit=$(COMMIT) \
-X github.com/toasterbook88/axis/internal/buildinfo.Date=$(DATE) \
-X github.com/toasterbook88/axis/internal/buildinfo.GoVersion=$(GOVERSION) \
-X github.com/toasterbook88/axis/internal/buildinfo.UpdateManagedBy=
.PHONY: build test test-race lint coverage clean install
build:
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o axis ./cmd/axis/
install: build
cp axis $(shell go env GOPATH)/bin/axis
test:
go test ./... -count=1 -timeout 180s
test-race:
go test ./... -count=1 -timeout 180s -race
lint:
gofmt -l . | grep -q . && { echo "gofmt needed"; exit 1; } || true
go vet ./...
coverage:
./hack/coverage-check.sh
clean:
rm -f axis