-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathMakefile
48 lines (36 loc) · 893 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROJ := thesis
SRC := $(PROJ).tex
DEP := $(wildcard *.tex *.bib) ucithesis.cls
OUT := .
DVI := $(OUT)/$(PROJ).dvi
PDF := $(OUT)/$(PROJ).pdf
# Can also use pdflatex, if preferred
CMDLATEX := latex -output-directory=$(OUT)
CMDPDF := dvipdf
PDFVIEWER := evince
all: $(DVI) $(PDF)
$(PDF) : $(DVI)
$(CMDPDF) $(DVI) $(PDF)
# OUT directory must be ordered before we generate output
$(OUT)/%.dvi: %.tex | $(OUT)
$(CMDLATEX) $<
bibtex $(OUT)/$(<:%.tex=%)
$(CMDLATEX) $<
$(CMDLATEX) $< # Run LaTeX again to make sure all references are correct
$(DVI) : $(DEP)
# Create the OUT directory, if it doesn't exist
$(OUT):
mkdir -p $@
show : $(PDF)
$(PDFVIEWER) "$(PDF)"
clean :
rm -rf $(OUT)/*.aux
rm -rf $(OUT)/*.bbl
rm -rf $(OUT)/*.blg
rm -rf $(OUT)/*.dvi
rm -rf $(OUT)/*.lof
rm -rf $(OUT)/*.log
rm -rf $(OUT)/*.lot
rm -rf $(OUT)/*.out
rm -rf $(OUT)/*.toc
rm -rf $(OUT)/*.pdf