-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
44 lines (34 loc) · 1.05 KB
/
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
# Simple Xe/LaTeX Makefile
# (C) Andrew Mundy 2012
# Configuration
TEX=pdflatex
BIB=bibtex
TEXFLAGS=--shell-escape
BIBFLAGS=
texdoc=procedural
FIGURES :=$(wildcard figures/*.*)
TIKZ_SOURCE :=$(wildcard figures/*.tex)
TIKZ_PDF :=$(foreach fig,$(basename $(TIKZ_SOURCE)),$(fig)pdf)
.PHONY: clean bib count all
# Make all items
all : $(texdoc).pdf
$(texdoc).pdf : $(texdoc).tex $(FIGURES)
$(TEX) $(TEXFLAGS) $(texdoc)
# Generate reference requirements
$(texdoc).aux : $(texdoc).tex
$(TEX) $(TEXFLAGS) $(texdoc)
# Generate the bibliography
bib : $(texdoc).aux
$(BIB) $(BIBFLAGS) $(texdoc)
$(TEX) $(TEXFLAGS) $(texdoc)
$(TEX) $(TEXFLAGS) $(texdoc)
# Build PDFs from Tikz diagrams
figures/%.pdf: figures/%.tex
pdflatex -output-directory=figures/ $<
# Build EPSs from PDFs
figures/%.eps: figures/%.pdf
gs -q -dNOCACHE -dNOPAUSE -dBATCH -dSAFER -sDEVICE=eps2write -sOutputFile=$@ $<
# Clean
clean :
find . -type f -regex ".*$(texdoc).*\.\(aux\|bbl\|bcf\|blg\|log\|png\|out\|toc\|lof\|lot\|count\)" -delete
rm -f $(texdoc).pdf $(texdoc).run.xml $(texdoc)-blx.bib