.PHONY: help run settings sync dev lint format test smoke clean build-appimage build-installer

help:
	@echo "Targets:"
	@echo "  run             - run flow-local (push-to-talk dictation app)"
	@echo "  settings        - open the settings UI"
	@echo "  sync            - install runtime dependencies (uv sync)"
	@echo "  dev             - install runtime + dev dependencies (uv sync --dev)"
	@echo "  lint            - run ruff check"
	@echo "  format          - run ruff format"
	@echo "  test            - run pytest"
	@echo "  smoke           - run end-to-end smoke test (needs GPU + Ollama)"
	@echo "  clean           - remove caches and __pycache__"
	@echo "  build-appimage  - build the Linux AppImage (packaging/linux/)"
	@echo "  build-installer - PyInstaller onedir build for this OS (packaging/pyinstaller/);"
	@echo "                    Windows/macOS still need Inno Setup / hdiutil on top, see"
	@echo "                    packaging/windows/installer.iss and packaging/macos/build_dmg.sh"

run:
	uv run flow-local

settings:
	uv run python -m flow_local.settings_server

sync:
	uv sync

dev:
	uv sync --dev

lint:
	uv run ruff check .

format:
	uv run ruff format .

test:
	uv run pytest

smoke:
	uv run python smoke_test.py

clean:
	rm -rf .pytest_cache .ruff_cache __pycache__

build-appimage:
	uv sync --group packaging
	packaging/linux/build_appimage.sh

build-installer:
	uv sync --group packaging
	uv run pyinstaller packaging/pyinstaller/flow-local.spec \
		--distpath packaging/dist --workpath packaging/build --noconfirm
