.PHONY: run bench-select test build install

# Version can be set via: make build VERSION=v1.2.3
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")

run:
	go run ./cmd -o ./playground/db ./playground/schema.sql

bench-select:
	go test ./playground -bench BenchmarkSelect -memprofile memprofile.out -cpuprofile profile.out

test:
	go test ./playground

# Build with version information
build:
	go build -ldflags "-X main.version=$(VERSION)" -o pgm ./cmd

# Install to GOPATH/bin with version
install:
	go install -ldflags "-X main.version=$(VERSION)" ./cmd

# Show current version
version:
	@echo "Version: $(VERSION)"
