.PHONY: build run test clean deps migrate

# Build the application
build:
	go build -o bin/calypso-api ./cmd/calypso-api

# Run the application locally
run:
	go run ./cmd/calypso-api -config config.yaml.example

# Run tests
test:
	go test ./...

# Run tests with coverage
test-coverage:
	go test -coverprofile=coverage.out ./...
	go tool cover -html=coverage.out

# Format code
fmt:
	go fmt ./...

# Lint code
lint:
	golangci-lint run ./...

# Download dependencies
deps:
	go mod download
	go mod tidy

# Clean build artifacts
clean:
	rm -rf bin/
	rm -f coverage.out

# Install dependencies
install-deps:
	go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

# Build for production (Linux)
build-linux:
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o bin/calypso-api-linux ./cmd/calypso-api

