-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 1.32 KB
/
Copy pathMakefile
File metadata and controls
44 lines (32 loc) · 1.32 KB
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
44
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -X main.version=$(VERSION)
BINARY := waxon
.PHONY: build test lint fmt cover install clean check demo record record-one
build: ## Build the binary
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .
test: ## Run tests with race detector
go test -race ./...
lint: ## Run golangci-lint
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4 run
fmt: ## Format code with gofumpt
go run mvdan.cc/gofumpt@latest -w .
cover: ## Run tests with coverage
go test -race -coverprofile=coverage.out ./...
check: fmt lint test ## Format, lint, and test (full CI locally)
install: ## Install the binary
go install -ldflags "$(LDFLAGS)" .
clean: ## Remove build artifacts
rm -f $(BINARY) waxon-demo coverage.out
demo: ## Launch waxon in demo mode
go build -tags demo -ldflags "$(LDFLAGS)" -o waxon-demo . && ./waxon-demo demo
record: ## Record all VHS tapes to demo/recordings/
@mkdir -p demo/recordings
go build -tags demo -ldflags "$(LDFLAGS)" -o waxon-demo .
@for tape in demo/tapes/*.tape; do \
echo "Recording $$tape..."; \
vhs "$$tape"; \
done
record-one: ## Record a single tape: make record-one TAPE=navigation
@mkdir -p demo/recordings
go build -tags demo -ldflags "$(LDFLAGS)" -o waxon-demo .
vhs demo/tapes/$(TAPE).tape