.PHONY: build run dev test clean lint

# Binary name
BINARY=spsays-bff
BUILD_DIR=./bin

# Build
build:
	@echo "Building..."
	@go build -o $(BUILD_DIR)/$(BINARY) ./cmd/api

# Run (build + execute)
run: build
	@$(BUILD_DIR)/$(BINARY)

# Dev (with live reload — requires air: go install github.com/air-verse/air@latest)
dev:
	@air -c .air.toml || go run ./cmd/api

# Test
test:
	@go test -v -race -cover ./...

# Clean
clean:
	@rm -rf $(BUILD_DIR)
	@go clean

# Lint (requires golangci-lint)
lint:
	@golangci-lint run ./...

# Tidy dependencies
tidy:
	@go mod tidy
