# yt-scraper — atajos para macOS/Linux (y test/clean multiplataforma).
#
# macOS trae `make` de fabrica, asi que un Mac nuevo queda sirviendo con:
#     make setup && make serve
# En Windows estos targets solo orientan: usa los .bat / .ps1 del proyecto
#     (start-server.bat, stop-server.bat, scripts/doctor.ps1).

# En Windows (GNU make define OS=Windows_NT) los scripts .sh no aplican.
ifeq ($(OS),Windows_NT)

setup:
	@echo [Windows] Los scripts .sh son para macOS/Linux. Usa scripts\doctor.ps1 o instala a mano: pip install -e ".[dev,web,analysis]"

serve:
	@echo [Windows] Usa start-server.bat

stop:
	@echo [Windows] Usa stop-server.bat

test:
	uv run python -m pytest -q || python -m pytest -q

else

setup:
	@bash scripts/bootstrap.sh

serve:
	@bash scripts/start-server.sh

stop:
	@bash scripts/stop-server.sh

test:
	@if command -v uv >/dev/null 2>&1; then uv run python -m pytest -q; else python -m pytest -q; fi

endif

# Borra solo caches de Python; no toca datos, venv ni .run/.
clean:
	@find . -path ./.venv -prune -o -path ./.venv-312 -prune -o -type d \( -name __pycache__ -o -name .pytest_cache \) -prune -exec rm -rf {} +
	@echo caches eliminadas.

.PHONY: setup serve stop test clean
