-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (77 loc) · 2.89 KB
/
Makefile
File metadata and controls
98 lines (77 loc) · 2.89 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.PHONY: build build-all build-darwin-arm64 build-darwin-amd64 build-linux-amd64 build-linux-arm64
.PHONY: test clean install lint fmt deps run dev run-projects run-doctor tools skill verify-pricing audit-schema
VERSION ?= dev
BUILD_TIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS := -ldflags "-X main.version=$(VERSION) -X main.buildTime=$(BUILD_TIME)"
GOBIN := $(or $(shell go env GOBIN),$(shell go env GOPATH)/bin)
# Default: build for current OS/arch
build:
@go build $(LDFLAGS) -o bin/ccx ./cmd/ccx
@echo ""
@echo " ccx built successfully"
@echo " ─────────────────────────────────────"
@echo " Binary: bin/ccx ($$(go env GOOS)/$$(go env GOARCH))"
@echo " Version: $(VERSION)"
@echo ""
@echo " Quick start:"
@echo " ./bin/ccx --help"
@echo " ./bin/ccx web"
@echo ""
@echo " Docs: https://github.com/thevibeworks/ccx"
@echo ""
# Cross-platform builds (pure Go, CGO disabled)
build-darwin-arm64:
@CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin/ccx-darwin-arm64 ./cmd/ccx
@echo "Built bin/ccx-darwin-arm64"
build-darwin-amd64:
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/ccx-darwin-amd64 ./cmd/ccx
@echo "Built bin/ccx-darwin-amd64"
build-linux-amd64:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/ccx-linux-amd64 ./cmd/ccx
@echo "Built bin/ccx-linux-amd64"
build-linux-arm64:
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o bin/ccx-linux-arm64 ./cmd/ccx
@echo "Built bin/ccx-linux-arm64"
build-all: build-darwin-arm64 build-darwin-amd64 build-linux-amd64 build-linux-arm64
@echo "Built all platforms in bin/"
install:
go install $(LDFLAGS) ./cmd/ccx
test:
go test -v ./...
# Install dev tools (golangci-lint, goimports)
tools:
@echo "Installing dev tools to $(GOBIN)..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install golang.org/x/tools/cmd/goimports@latest
@echo "Done."
lint:
@test -x $(GOBIN)/golangci-lint || { echo "golangci-lint not found. Run 'make tools' first."; exit 1; }
$(GOBIN)/golangci-lint run
fmt:
gofmt -s -w .
@test -x $(GOBIN)/goimports && $(GOBIN)/goimports -w . || true
clean:
rm -rf bin/
deps:
go mod download
go mod tidy
run: build
./bin/ccx
dev: build
./bin/ccx web
run-projects: build
./bin/ccx projects
run-doctor: build
./bin/ccx doctor
skill:
cd skills && zip -r ../ccx.skill ccx/
@echo "Packaged: ccx.skill"
# verify-pricing compares ccx's embedded pricing table against Claude
# Code's source of truth (modelCost.ts). Requires a local checkout of
# claude-code under ../../reference/claude-code-2188 by default; pass
# CLAUDE_SOURCE=<path> to override. Exits non-zero on drift.
CLAUDE_SOURCE ?= ../../reference/claude-code-2188
verify-pricing:
@go run ./cmd/ccx-verify-pricing --claude-source $(CLAUDE_SOURCE)
audit-schema:
go run ./cmd/ccx-audit-schema $(ARGS)