# Vellum — developer commands.
#
# Requires Go >= 1.26. On Fedora: sudo dnf install golang

BINARY  := vellum
VERSION ?= 0.1.0-dev
LDFLAGS := -s -w -X main.version=$(VERSION)

.PHONY: build run test fmt vet tidy check docker clean

build:
	CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/vellum

run:
	go run ./cmd/vellum

test:
	go test ./...

fmt:
	gofmt -w .

vet:
	go vet ./...

tidy:
	go mod tidy

# What CI should run.
check: fmt vet test

docker:
	podman build --build-arg VERSION=$(VERSION) -t localhost/vellum:$(VERSION) .

clean:
	rm -f $(BINARY)
	rm -rf data config
