Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 2.07 KB
/
Copy pathMakefile
File metadata and controls
69 lines (56 loc) · 2.07 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 2019-2021 Michael Pilosov
# check for required binaries, fail gracefully with helpful error message.
REQUIRED_BINS := latexmk
$(foreach bin,$(REQUIRED_BINS),\
$(if $(shell command -v $(bin) 2> /dev/null),$(info Found `$(bin)`),$(error Please install `$(bin)`)))
# find all files required to compile / files that should trigger an update
CHAPTERS = $(shell find . -type f -name 'chapter*.tex')
APPENDIX = $(shell find . -type f -name 'appendix*.tex')
# changes to images/figures: add/edit this line to reflect your file types
# if you create a new variable (perhaps to track a folder), add it to target
IMAGES = $(shell find . -type f -name '*.png')
FIGURES = $(shell find . -type f -name '*.pdf' | grep 'figures')
REFS = $(shell find . -type f -name 'references*.bib')
# custom latex environment/styles for python, bash, etc. (syntax highlighting)
ENVS = $(shell find . -type f -name '*env.tex')
# file name (without .tex)
FILENAME = dissertation
# dependency list: if changes detected in dependency, rebuild target
TEXFILES := \
$(FILENAME) \
abstract \
notation \
body \
intro/* \
set-based/set_derivation \
set-based/set_algorithm \
set-based/set_error \
env/newcommands \
env/usepackages \
extensions/* \
software/* \
ch02/* \
ch03/* \
# adds .tex to path name
TEXS = $(patsubst %, %.tex, $(TEXFILES))
# style-file dependendencies (unlikely to change these, but just in case)
DEPS := \
ref/ucdDissertation.bst \
ucdenver-dissertation.cls \
# targets that are labeled as PHONY are treated as always needing an update
# a file doesn't actually need to exist for it to run
.PHONY: all clean examples
# the first real target is the one used when no other arguments are passed to `make`
# by creating a dependency on the pdf, we trigger a compilation by default.
all: $(FILENAME).pdf
# our main target
$(FILENAME).pdf: $(TEXS) $(CHAPTERS) $(APPENDIX) $(REFS) $(IMAGES) $(FIGURES) $(ENVS) $(DEPS)
latexmk -gg -pdf -bibtex $(FILENAME).tex
examples:
cd examples && \
make
echo "All examples built."
clean:
latexmk -c $(FILENAME).tex
/bin/rm -f *.spl
/bin/rm -f *.bbl