-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (55 loc) · 1.35 KB
/
Makefile
File metadata and controls
73 lines (55 loc) · 1.35 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
69
70
71
72
73
LANG = en-US
TMP_DIR ?= /tmp/$(notdir $(CURDIR))
TEXS ?= $(wildcard *.tex)
PDFS ?= $(TEXS:.tex=.pdf)
TXTS ?= $(TEXS:.tex=.txt)
LATEXMKFLAGS+=-pdf -pdflatex="pdflatex --shell-escape %O %S"
########################################################################
# top-level targets for compilation in /tmp
#
all: pdf
# You can suffix all targets with "_in_tmp", e.g. ``make debug_in_tmp``.
# If you have a tmpfs mounted to ``/tmp`` you can use this to speed up
# compilation.
%_in_tmp:
rsync -qa --inplace "$(CURDIR)/" "$(TMP_DIR)/"
$(MAKE) -C "$(TMP_DIR)" $*
########################################################################
# top-level targets
#
debug: $(PDFS)
pdf: LATEXMKFLAGS += -quiet
pdf: $(PDFS)
########################################################################
# targets for specific files
#
%.pdf: %.tex
latexmk $(LATEXMKFLAGS) $^
%.txt: %.pdf
pdftotext $^ > $@
########################################################################
# QA, stats, etc.
#
count: $(TEXS)
texcount -inc $^
languagetool: $(TXTS)
languagetool-commandline -l $(LANG) $^
lint: $(TEXS)
for f in $^; do \
lacheck $$f; \
chktex $$f; \
done
clean:
latexmk -c
find \( \
-type f \
-name '*.bbl' \
-or -name '*-blx.bib' \
-or -name '*.run.xml' \
-or -name '*.aux' \
\) -exec rm {} \;
rm -rf "$(TMP_DIR)"
distclean:
rm -f \
$(PDFS) \
$(TXTS)