TEX = rtpe_audit.tex
PDF = $(TEX:.tex=.pdf)

.PHONY: all clean watch

all: $(PDF)

%.pdf: %.tex
	pdflatex -interaction=nonstopmode -halt-on-error $<
	pdflatex -interaction=nonstopmode -halt-on-error $<

clean:
	rm -f *.aux *.log *.out *.toc *.pdf

# Rebuild on every save (requires fswatch or entr; falls back to a poll loop).
watch:
	@while true; do $(MAKE) all; sleep 2; \
	  find $(TEX) -newer $(PDF) -print -quit | grep -q . || sleep 3; done
