-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (57 loc) · 1.4 KB
/
Makefile
File metadata and controls
74 lines (57 loc) · 1.4 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Chief - Autonomous PRD Agent
# https://github.com/minicodemonkey/chief
BINARY_NAME := chief
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
BIN_DIR := ./bin
BUILD_DIR := ./build
MAIN_PKG := ./cmd/chief
# Go build flags
LDFLAGS := -ldflags "-X main.Version=$(VERSION)"
.PHONY: all build install test lint clean release snapshot help
all: build
## build: Build the binary
build:
@mkdir -p $(BIN_DIR)
go build $(LDFLAGS) -o $(BIN_DIR)/$(BINARY_NAME) $(MAIN_PKG)
## install: Install to $GOPATH/bin
install:
go install $(LDFLAGS) $(MAIN_PKG)
## test: Run all tests
test:
go test -v ./...
## test-short: Run tests without verbose output
test-short:
go test ./...
## lint: Run linters (requires golangci-lint)
lint:
golangci-lint run ./...
## vet: Run go vet
vet:
go vet ./...
## fmt: Format code
fmt:
go fmt ./...
## tidy: Tidy and verify dependencies
tidy:
go mod tidy
go mod verify
## clean: Remove build artifacts
clean:
rm -rf $(BIN_DIR)
rm -rf $(BUILD_DIR)
rm -rf dist/
## snapshot: Build snapshot release with goreleaser
snapshot:
goreleaser release --snapshot --clean
## release: Build release (requires GITHUB_TOKEN)
release:
goreleaser release --clean
## run: Build and run the TUI
run: build
$(BIN_DIR)/$(BINARY_NAME)
## help: Show this help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /'