.PHONY: run build clean fmt

export CGO_CFLAGS=-Wno-deprecated-declarations

run:
	@go run ./cmd/lilguy

build:
	@go build -o bin/lilguy ./cmd/lilguy

clean:
	@rm -rf bin/
	@go clean

fmt:
	@go fmt ./...

# Install dependencies
deps:
	@go mod download
	@go mod tidy

# Run with verbose output
run-verbose:
	@go run -v ./cmd/lilguy

# Build for current platform
build-local: clean
	@mkdir -p bin
	@go build -o bin/lilguy ./cmd/lilguy
	@echo "Built: bin/lilguy"

# Build for multiple platforms
build-all: clean
	@mkdir -p bin
	GOOS=darwin GOARCH=arm64 go build -o bin/lilguy-darwin-arm64 ./cmd/lilguy
	GOOS=darwin GOARCH=amd64 go build -o bin/lilguy-darwin-amd64 ./cmd/lilguy
	GOOS=linux GOARCH=amd64 go build -o bin/lilguy-linux-amd64 ./cmd/lilguy
	GOOS=windows GOARCH=amd64 go build -o bin/lilguy-windows-amd64.exe ./cmd/lilguy
	@echo "Built all platforms"

help:
	@echo "Available targets:"
	@echo "  run          - Run the game"
	@echo "  build        - Build binary to bin/"
	@echo "  clean        - Remove build artifacts"
	@echo "  fmt          - Format code"
	@echo "  deps         - Download and tidy dependencies"
	@echo "  build-local  - Clean build for current platform"
	@echo "  build-all    - Build for all platforms"
