Files
sgard/Makefile
Kyle Isom adfb087037 Derive build version from git tags via VERSION file.
flake.nix reads from VERSION instead of hardcoding; Makefile gains
a version target that syncs VERSION from the latest git tag and
injects it into go build ldflags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:26:16 -07:00

26 lines
464 B
Makefile

VERSION := $(shell git describe --tags --abbrev=0 | sed 's/^v//')
.PHONY: proto build test lint clean version
proto:
protoc \
--go_out=. --go_opt=module=github.com/kisom/sgard \
--go-grpc_out=. --go-grpc_opt=module=github.com/kisom/sgard \
-I proto \
proto/sgard/v1/sgard.proto
version:
@echo $(VERSION) > VERSION
build:
go build -ldflags "-X main.version=$(VERSION)" ./...
test:
go test ./...
lint:
golangci-lint run ./...
clean:
rm -f sgard