.PHONY: install run dev test clean help

help:
	@echo "Rexa Search - Makefile"
	@echo ""
	@echo "Available targets:"
	@echo "  install   - Install package in development mode"
	@echo "  run       - Start server on port 8088"
	@echo "  dev       - Start with auto-reload"
	@echo "  test      - Run tests (if any)"
	@echo "  clean     - Remove cache and build artifacts"
	@echo "  build     - Build package"
	@echo "  help      - Show this help message"

install:
	pip install markdown pygments openai -e .
	pip install -e .

run:
	python -m rexa

dev:
	uvicorn rexa.main:app.app --host 0.0.0.0 --port 8088 --reload

test:
	python -m pytest tests/ -v || echo "No tests found"

clean:
	rm -rf cache.db
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info/
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete

build:
	python -m build

uninstall:
	pip uninstall rexa-search -y
