-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (20 loc) · 738 Bytes
/
Copy pathMakefile
File metadata and controls
27 lines (20 loc) · 738 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
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
MODULE := github.com/danielwolfman/prdash
BINARY := prdash
MAIN := ./cmd/prdash
DIST := ./dist
LDFLAGS := -s -w -X $(MODULE)/internal/app.Version=$(VERSION) -X $(MODULE)/internal/app.Commit=$(COMMIT) -X $(MODULE)/internal/app.Date=$(DATE)
.PHONY: test build install snapshot clean
test:
go test ./...
build:
mkdir -p $(DIST)
go build -trimpath -ldflags '$(LDFLAGS)' -o $(DIST)/$(BINARY) $(MAIN)
install:
go install -trimpath -ldflags '$(LDFLAGS)' $(MAIN)
snapshot:
goreleaser release --snapshot --clean
clean:
rm -rf $(DIST)