-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 781 Bytes
/
Makefile
File metadata and controls
39 lines (27 loc) · 781 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
35
36
37
38
39
BINARY := wt
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X github.com/bkildow/wt-cli/cmd.version=$(VERSION) \
-X github.com/bkildow/wt-cli/cmd.commit=$(COMMIT) \
-X github.com/bkildow/wt-cli/cmd.date=$(DATE)
.DEFAULT_GOAL := build
.PHONY: build install test test-short e2e vet fmt clean dev
build:
go build -ldflags '$(LDFLAGS)' -o $(BINARY) ./cmd/wt
install:
go install -ldflags '$(LDFLAGS)' ./cmd/wt
test:
go test ./...
test-short:
go test -short ./...
e2e:
go test ./e2e/ -count=1
vet:
golangci-lint run ./...
fmt:
gofumpt -l -w .
clean:
rm -f $(BINARY)
dev: fmt vet test build