# THE TESTAMENT — Build System
# Usage: make all | make pdf | make epub | make html | make md | make clean

.PHONY: all pdf epub html md clean check

all: md epub html

md:
	python3 build/build.py --md

epub: md
	python3 build/build.py --epub

pdf: md
	python3 build/build.py --pdf

html: md
	python3 build/build.py --html

clean:
	rm -f testament-complete.md
	rm -f build/output/*.epub build/output/*.pdf
	rm -f testament.epub testament.html testament.pdf

check:
	@which pandoc >/dev/null 2>&1 && echo "✓ pandoc" || echo "✗ pandoc (brew install pandoc)"
	@which xelatex >/dev/null 2>&1 && echo "✓ xelatex" || echo "✗ xelatex (install MacTeX)"
	@python3 -c "import weasyprint" 2>/dev/null && echo "✓ weasyprint" || echo "— weasyprint (optional, PDF fallback)"
