-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 1.29 KB
/
Makefile
File metadata and controls
38 lines (29 loc) · 1.29 KB
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
# Baylor University Thesis LaTeX template
#
# Trash auxiliary files: make clean
# Compile thesis: make
LATEX = pdflatex
BIBTEX = bibtex
MAKEINDEX = makeindex
RERUN = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
RERUNBIB = "No file.*\.bbl|Citation.*undefined"
MAKEIDX = "^[^%]*\\makeindex"
MAIN_TEX := thesis.tex
TARGET = $(MAIN_TEX:%.tex=%.pdf)
COPY = if test -r $(<:%.tex=%.toc); then cp $(<:%.tex=%.toc) $(<:%.tex=%.toc.bak); fi
all: $(TARGET)
$(TARGET): %.pdf : %.tex *.tex chapters/*.tex
$(COPY);$(LATEX) $<
egrep -q $(MAKEIDX) $< && ($(MAKEINDEX) $(<:%.tex=%);$(COPY);$(LATEX) $<) ; true
egrep -c $(RERUNBIB) $(<:%.tex=%.log) && ($(BIBTEX) $(<:%.tex=%);$(COPY);$(LATEX) $<) ; true
egrep -q $(RERUN) $(<:%.tex=%.log) && ($(COPY);$(LATEX) $<) ; true
egrep -q $(RERUN) $(<:%.tex=%.log) && ($(COPY);$(LATEX) $<) ; true
if cmp -s $(<:%.tex=%.toc) $(<:%.tex=%.toc.bak); then true ;else $(LATEX) $< ; fi
rm -f $(<:%.tex=%.toc.bak)
# Display relevant warnings
egrep -i "(Reference|Citation).*undefined" $(<:%.tex=%.log) ; true
clean:
-rm -f $(TARGET) $(PSF) $(PDF) $(MAIN_TEX:%.tex=%.bbl) $(MAIN_TEX:%.tex=%.blg) \
$(MAIN_TEX:%.tex=%.log) $(MAIN_TEX:%.tex=%.out) $(MAIN_TEX:%.tex=%.lof) \
$(MAIN_TEX:%.tex=%.lot) $(MAIN_TEX:%.tex=%.toc) *.aux
.PHONY: all clean