Files
chat/Makefile
clawbot ae1c67050e build: update Dockerfile with tests and multi-stage build, add Makefile
- Dockerfile runs go test before building
- Multi-stage: build+test stage, minimal alpine final image
- Add gcc/musl-dev for CGO (sqlite)
- Trim binaries with -s -w ldflags
- Makefile with build, test, clean, docker targets
- Version injection via ldflags
2026-02-10 18:21:07 -08:00

18 lines
396 B
Makefile

VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.Version=$(VERSION)"
.PHONY: build test clean docker
build:
go build $(LDFLAGS) -o chatd ./cmd/chatd/
go build $(LDFLAGS) -o chat-cli ./cmd/chat-cli/
test:
DBURL="file::memory:?cache=shared" go test ./...
clean:
rm -f chatd chat-cli
docker:
docker build -t chat:$(VERSION) .