-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (64 loc) · 2.47 KB
/
Makefile
File metadata and controls
81 lines (64 loc) · 2.47 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
APP ?= csgclaw
BIN_DIR ?= bin
BIN ?= $(BIN_DIR)/$(APP)
DIST_DIR ?= dist
GOCACHE ?= $(CURDIR)/.gocache
VERSION ?= dev
GO ?= go
GOFMT ?= gofmt
ONBOARD_BASE_URL ?= http://127.0.0.1:4000
ONBOARD_API_KEY ?= sk-1234567890
ONBOARD_MODEL_ID ?= minimax-m2.7
ONBOARD_MANAGER_IMAGE ?= ghcr.io/russellluo/picoclaw:2026.3.27
IMAGE ?= ghcr.io/russellluo/picoclaw
TAG ?= 2025.3.25
LOCAL_IMAGE ?= picoclaw:local
.PHONY: help fmt test build run onboard clean package release tag push publish boxlite-setup
help:
@printf '%s\n' \
'make fmt - format Go files' \
'make boxlite-setup - fetch BoxLite native library if missing' \
'make test - run Go tests with local build cache' \
'make build - build $(BIN)' \
'make run - run the server in foreground' \
'make onboard - initialize ~/.csgclaw/config.toml with defaults' \
'make package - package current platform binary into dist/' \
'make release - build release archives for macOS/Linux/Windows' \
'make clean - remove local build outputs' \
'make tag - tag local manager image' \
'make push - push manager image' \
'make publish - tag and push manager image'
fmt:
$(GOFMT) -w $(shell find cmd internal -name '*.go')
boxlite-setup:
@if [ ! -f third_party/boxlite-go/libboxlite.a ]; then \
echo "fetching BoxLite native library..."; \
cd third_party/boxlite-go && BOXLITE_SDK_VERSION=v0.7.6 $(GO) run ./cmd/setup; \
fi
test: boxlite-setup
env GOCACHE=$(GOCACHE) $(GO) test ./...
build: boxlite-setup
mkdir -p $(BIN_DIR)
env GOCACHE=$(GOCACHE) $(GO) build -o $(BIN) ./cmd/csgclaw
run: boxlite-setup
env GOCACHE=$(GOCACHE) $(GO) run ./cmd/csgclaw start
onboard: boxlite-setup
env GOCACHE=$(GOCACHE) $(GO) run ./cmd/csgclaw onboard \
--base-url $(ONBOARD_BASE_URL) \
--api-key $(ONBOARD_API_KEY) \
--model-id $(ONBOARD_MODEL_ID) \
--manager-image $(ONBOARD_MANAGER_IMAGE)
package: boxlite-setup
mkdir -p $(DIST_DIR)
VERSION=$(VERSION) DIST_DIR=$(DIST_DIR) APP=$(APP) GOCACHE=$(GOCACHE) $(CURDIR)/scripts/package-release.sh $$(go env GOOS) $$(go env GOARCH)
release: boxlite-setup
mkdir -p $(DIST_DIR)
VERSION=$(VERSION) DIST_DIR=$(DIST_DIR) APP=$(APP) GOCACHE=$(GOCACHE) $(CURDIR)/scripts/package-release.sh darwin arm64
VERSION=$(VERSION) DIST_DIR=$(DIST_DIR) APP=$(APP) GOCACHE=$(GOCACHE) $(CURDIR)/scripts/package-release.sh linux amd64
clean:
rm -rf $(BIN_DIR) $(DIST_DIR) $(GOCACHE)
tag:
docker tag $(LOCAL_IMAGE) $(IMAGE):$(TAG)
push:
docker push $(IMAGE):$(TAG)
publish: tag push