Files
mc-proxy/Makefile
T
kyleandClaude Fable 5.1 cc03cc2981 Makefile: build with CGO_ENABLED=0; drop committed mcproxyctl binary
The binary was a build output checked in by mistake; ignore it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 15:04:53 -07:00

50 lines
1.2 KiB
Makefile

.PHONY: build test vet lint proto proto-lint clean docker push all devserver
MCR := mcr.svc.mcp.metacircular.net:8443
VERSION := $(shell git describe --tags --always --dirty)
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(VERSION)"
CGO := CGO_ENABLED=0
mc-proxy:
$(CGO) go build $(LDFLAGS) -o mc-proxy ./cmd/mc-proxy
mcproxyctl:
$(CGO) go build -trimpath -ldflags="-s -w" -o mcproxyctl ./cmd/mcproxyctl
build:
go build ./...
test:
go test ./...
vet:
go vet ./...
lint:
golangci-lint run ./...
proto:
protoc --go_out=. --go_opt=module=git.wntrmute.dev/mc/mc-proxy \
--go-grpc_out=. --go-grpc_opt=module=git.wntrmute.dev/mc/mc-proxy \
proto/mc_proxy/v1/*.proto
proto-lint:
buf lint
buf breaking --against '.git#branch=master,subdir=proto'
clean:
rm -f mc-proxy mcproxyctl
docker:
docker build --build-arg VERSION=$(VERSION) -t $(MCR)/mc-proxy:$(VERSION) -f Dockerfile .
push: docker
docker push $(MCR)/mc-proxy:$(VERSION)
devserver: mc-proxy
@mkdir -p srv
@if [ ! -f srv/mc-proxy.toml ]; then cp mc-proxy.toml.example srv/mc-proxy.toml; echo "Created srv/mc-proxy.toml from example — edit before running."; fi
./mc-proxy server --config srv/mc-proxy.toml
all: vet lint test mc-proxy