# Configuration NAME = my-thesis MAIN = main.tex BUILD_DIR = temp # Do not change below this line # -------------------------------------------------------------------- .PHONY: pdf clean zip init SOURCES = $(wildcard *.tex) $(wildcard content/*) $(wildcard style/*) $(wildcard images/*) $(wildcard/appendix/*) $(wildcard main.bib) ARCHIVE=$(NAME).zip LATEX=pdflatex -halt-on-error -interaction=nonstopmode -output-directory $(BUILD_DIR) -jobname=$(NAME) $(MAIN) >/dev/null BIB=bibtex $(BUILD_DIR)/$(NAME) GLOSSARIES=makeglossaries -d $(BUILD_DIR) $(NAME) >/dev/null pdf: $(BUILD_DIR)/$(NAME).pdf # Rule to build the PDF # Need to run pdflatex three times to get the references right $(BUILD_DIR)/$(NAME).pdf: $(SOURCES) $(BUILD_DIR) @echo "Building PDF..." @$(LATEX) $(BIB) $(GLOSSARIES) @$(LATEX) $(LATEX) $(BUILD_DIR): mkdir -p $@ # Zip target zip: $(NAME).zip $(NAME).zip: $(SOURCES) zip -r $(NAME).zip $(SOURCES) # Clean rule clean: trash -f $$(tr '\n' ' ' < .gitignore) # Create new project init: LICENSE LICENSE: @echo -e "*.aux\\n\ *.bbl\\n\ *.brf\\n\ *.nlo\\n\ *.blg\\n\ *.log\\n\ *.fls\\n\ *.fdb_latexmk\\n\ *.toc\\n\ *.lof\\n\ *.lot\\n\ *.out\\n\ *.tdo\\n\ main.synctex.gz\\n\ main.pdf\\n\ .idea\\n\ out\\n\ *.zip\\n\ build\\n\ temp" > .gitignore