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