.PHONY: help test gui cli cli-ai cli-all-ai cli-help

# Help
# Show available make targets
help:
	@echo "Available targets:"
	@echo "  help       - Show this help"
	@echo "  test       - Run the test suite"
	@echo "  gui        - Launch the graphical Mancala game"
	@echo "  cli        - Play a 2-player game in the terminal (human vs human)"
	@echo "  cli-ai     - CLI with Player 2 as AI (greedy)"
	@echo "  cli-all-ai - CLI with all players as AI (watch AI play itself)"
	@echo "  cli-help   - Show all CLI options (-n, -s, -t, -d, -a, -A, -G)"

VENV = .venv

$(VENV)/bin/activate:
	python3 -m venv $(VENV)
	$(VENV)/bin/pip install pytest PySide6

# Test
# Run the test suite
test: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m pytest test_capture.py test_goal_plus_one.py test_sweep.py -v

# GUI
# Launch the graphical Mancala game
gui: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m mancala.mancala -G

# CLI
# Play a 2-player game in the terminal (human vs human)
cli: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m mancala.mancala

# CLI with AI opponent (Player 2 is AI, greedy)
cli-ai: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m mancala.mancala -a 2

# CLI with all AI players (watch AI play itself, greedy)
cli-all-ai: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m mancala.mancala -A

# Show CLI help (all options: -n players, -s pits, -t stones, -d ai-depth, etc.)
cli-help: $(VENV)/bin/activate
	. $(VENV)/bin/activate && python -m mancala.mancala --help
