# ========================================================================
# Makefile for dissertation template
# ========================================================================
# This Makefile provides convenient shortcuts for building the dissertation.
# It is primarily intended for local CLI usage (VimTeX users can also call
# make targets if desired). Overleaf does not support Makefiles.
#
# Usage:
#   make          -- build the dissertation PDF
#   make clean    -- remove auxiliary files
#   make distclean-- remove everything including the PDF
#   make watch    -- continuous preview mode (latexmk -pvc)
# ========================================================================

MAIN    := main
LATEXMK := latexmk
OUTDIR  := build

.PHONY: all clean distclean watch help

all: $(MAIN).pdf

$(MAIN).pdf: $(MAIN).tex
	$(LATEXMK) -pdf -synctex=1 $(MAIN).tex

clean:
	$(LATEXMK) -c $(MAIN).tex

distclean:
	$(LATEXMK) -C $(MAIN).tex

watch:
	$(LATEXMK) -pdf -pvc -synctex=1 $(MAIN).tex

help:
	@echo "Dissertation build targets:"
	@echo "  make        - Build the PDF"
	@echo "  make clean  - Remove auxiliary files"
	@echo "  make distclean - Remove PDF and all generated files"
	@echo "  make watch  - Continuous preview mode"
