-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (30 loc) · 1010 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (30 loc) · 1010 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
40
41
42
43
.PHONY: build test lint verify vulncheck goreleaser-check smoke run clean ci tui-snapshots tui-snapshots-claude
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
BINARY ?= bin/packetcode
GOVULNCHECK_VERSION ?= v1.3.0
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT)
build:
mkdir -p $(dir $(BINARY))
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/packetcode
test:
go test -race -count=1 ./...
lint:
golangci-lint run ./...
verify:
go mod verify
vulncheck:
go run golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION) ./...
goreleaser-check:
goreleaser check
smoke: build
./$(BINARY) --version
tui-snapshots: build
sh scripts/tui_snapshot_suite.sh packetcode
tui-snapshots-claude:
sh scripts/tui_snapshot_suite.sh claude
run: build
./$(BINARY)
ci: verify lint test vulncheck build smoke goreleaser-check
clean:
rm -rf bin/ dist/