.PHONY: proto proto-lint proto-breaking test build clean # Generate proto files proto: buf generate # Lint proto files proto-lint: buf lint # Check for breaking changes proto-breaking: buf breaking --against '.git#branch=main' # Run tests test: go test ./... # Build the relay build: go build -o bin/relay ./cmd/relay # Build test client build-client: go build -o bin/testclient ./cmd/testclient # Build everything build-all: build build-client # Clean generated files clean: rm -rf api/ rm -f bin/relay # Install buf (if not already installed) install-buf: @if ! command -v buf &> /dev/null; then \ echo "Installing buf..."; \ mkdir -p ~/.local/bin; \ curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$$(uname -s)-$$(uname -m)" -o ~/.local/bin/buf; \ chmod +x ~/.local/bin/buf; \ echo "buf installed to ~/.local/bin/buf"; \ echo "Make sure ~/.local/bin is in your PATH"; \ else \ echo "buf is already installed"; \ fi