# Sorry! — engine, GUI, tests, sounds

PY     := .venv/bin/python
PIP    := .venv/bin/pip

.PHONY: venv gui test sounds clean help
.DEFAULT_GOAL := help

venv:            ## Create .venv and install PySide6 + pillow
	python3 -m venv .venv
	$(PIP) install --upgrade pip
	$(PIP) install PySide6 pillow

gui:             ## Run the PySide6 GUI
	$(PY) sorry_gui.py

test:            ## Run the unit test suite
	$(PY) -m unittest test_sorry -v

sounds:          ## Regenerate sound assets into sounds/
	$(PY) gen_sounds.py

clean:           ## Remove caches and generated artifacts
	rm -rf __pycache__ .pytest_cache
	find . -name '__pycache__' -type d -exec rm -rf {} +
	rm -f gifs/*.png gifs/*.gif gui_*.png screenshots/*.png

help:            ## Show available targets
	@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[36m%-12s\033[0m %s\n", $$1, $$2}'
