MODULE := gitea.mynodes.xyz/ilker/llmgw VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev) LDFLAGS := -X '$(MODULE)/internal/version.Version=$(VERSION)' .PHONY: build test race lint fmt clean rename proto proto-tools build: go build -ldflags "$(LDFLAGS)" -o bin/llmgw ./cmd/llmgw test: go test ./... race: go test -race ./... lint: golangci-lint run fmt: go fmt ./... go vet ./... # Regenerate the agent protocol. Generated code is committed, so this only # needs running when api/proto changes. proto: proto-tools buf lint buf generate proto-tools: go install github.com/bufbuild/buf/cmd/buf@latest go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest clean: rm -rf bin dist # Change the module path: make rename NEW=git.example.com/team/llmgw rename: @test -n "$(NEW)" || (echo "usage: make rename NEW="; exit 1) go mod edit -module=$(NEW) grep -rl '$(MODULE)' --include='*.go' . | xargs sed -i '' 's|$(MODULE)|$(NEW)|g' sed -i '' 's|^MODULE := .*|MODULE := $(NEW)|' Makefile go build ./...