-
Notifications
You must be signed in to change notification settings - Fork 35
/
makefile
31 lines (25 loc) · 921 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
LATEXMK=./latexmk/latexmk
# Various dependencies
MAIN=thesis
MAIN_PDF=$(MAIN).pdf
MAIN_TEX=$(MAIN).tex
HELPER_FILES= makefile mnthesis.cls
PRELIMS:=$(wildcard preliminaries/*.tex)
CHAPTERS:=$(wildcard chapters/*.tex)
FIGURES := $(wildcard figures/*)
# Tell make what our reserved target names are
#
# By using ALWAYS_COMPILE as an undefined target, it will always force the main
# PDF to compile. latexmk is smart and will do the minimum needed each time.
.PHONY: ALWAYS_COMPILE clean all tidy
# The default target
all: $(MAIN_PDF)
# Instructions to make the main pdf
$(MAIN_PDF): ALWAYS_COMPILE $(MAIN_TEX) $(HELPER_FILES) $(PRELIMS) $(CHAPTERS) $(FIGURES)
$(LATEXMK) -pdf $(MAIN_TEX)
# Clean up all the regeneratable files except for the final document (the .pdf)
tidy: $(MAIN_PDF)
$(LATEXMK) -c $(MAIN_TEX)
# Clean up all the regeneratable files, including the final document
clean:
$(LATEXMK) -C $(MAIN_TEX)