# --- Deez Training Handbook build system --- ENGINE ?= lualatex MAIN = main SESSIONS := $(wildcard sessions/*.tex) intro.tex .PHONY: all clean distclean watch view help help: @echo "make -- build $(MAIN).pdf" @echo "make watch -- continuous build via latexmk -pvc" @echo "make view -- open the built PDF" @echo "make clean -- remove aux files" @echo "make distclean -- remove aux files and the built PDF" all: $(MAIN).pdf $(MAIN).pdf: $(MAIN).tex preamble.sty $(SESSIONS) latexmk -$(ENGINE) -interaction=nonstopmode -halt-on-error $(MAIN).tex watch: latexmk -$(ENGINE) -pvc -interaction=nonstopmode $(MAIN).tex view: $(MAIN).pdf open $(MAIN).pdf clean: -latexmk -c rm -f *.aux *.log *.out *.toc *.fls *.fdb_latexmk *.synctex.gz sessions/*.aux distclean: clean -latexmk -C rm -f $(MAIN).pdf