-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (18 loc) · 691 Bytes
/
Makefile
File metadata and controls
24 lines (18 loc) · 691 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
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)
LDFLAGS = -s -w \
-X github.com/peg/rampart/internal/build.Version=$(VERSION) \
-X github.com/peg/rampart/internal/build.Commit=$(COMMIT) \
-X github.com/peg/rampart/internal/build.Date=$(DATE)
.PHONY: build test vet clean linux
build:
go build -ldflags "$(LDFLAGS)" -o rampart ./cmd/rampart
linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o rampart-linux ./cmd/rampart
test:
go test ./...
vet:
go vet ./...
clean:
rm -f rampart rampart-linux