Files

49 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

.PHONY: build test vet lint proto proto-lint clean docker push all devserver
2026-03-17 02:56:24 -07:00
MCR := mcr.svc.mcp.metacircular.net:8443
VERSION := $(shell git describe --tags --always --dirty)
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(VERSION)"
2026-03-17 02:56:24 -07:00
mc-proxy:
go build $(LDFLAGS) -o mc-proxy ./cmd/mc-proxy
2026-03-19 08:09:13 -07:00
mcproxyctl:
go build -trimpath -ldflags="-s -w" -o mcproxyctl ./cmd/mcproxyctl
2026-03-17 02:56:24 -07:00
build:
go build ./...
test:
go test ./...
vet:
go vet ./...
lint:
golangci-lint run ./...
proto:
2026-03-27 02:05:59 -07:00
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'
2026-03-17 02:56:24 -07:00
clean:
2026-03-19 08:09:13 -07:00
rm -f mc-proxy mcproxyctl
2026-03-17 02:56:24 -07:00
docker:
docker build --build-arg VERSION=$(VERSION) -t $(MCR)/mc-proxy:$(VERSION) -f Dockerfile .
push: docker
docker push $(MCR)/mc-proxy:$(VERSION)
2026-03-17 02:56:24 -07:00
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