-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 742 Bytes
/
Makefile
File metadata and controls
28 lines (20 loc) · 742 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
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 = -ldflags "-X github.com/ghostwright/specter/pkg/version.Version=$(VERSION) \
-X github.com/ghostwright/specter/pkg/version.Commit=$(COMMIT) \
-X github.com/ghostwright/specter/pkg/version.Date=$(DATE)"
.PHONY: build install clean test lint ci run
build:
go build $(LDFLAGS) -o bin/specter ./cmd/specter
install:
go install $(LDFLAGS) ./cmd/specter
clean:
rm -rf bin/ dist/
test:
go test ./...
lint:
go vet ./...
ci: lint build
run:
go run $(LDFLAGS) ./cmd/specter $(ARGS)