-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathMakefile
52 lines (43 loc) · 1.15 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
45
46
47
48
49
50
51
52
main.pdf:
LATEX = pdflatex -interaction=nonstopmode
BIBTEX = bibtex -min-crossrefs=1000
RERUN = ! egrep -q '(^LaTeX Warning:|\(natbib\)).* Rerun'
UNDEFINED = ! egrep -q '^(LaTeX|Package natbib) Warning:.* undefined'
FIGPNG = $(wildcard *.png */*.png)
FIGSVG = $(wildcard *.svg */*.svg)
FIGGENPDF = $(patsubst %.svg,%.pdf,$(FIGSVG))
include */Makefrag
main.pdf: *.tex */*.tex *.sty *.bib $(FIGPNG) $(FIGGENPDF)
$(LATEX) main.tex || (rm -f main.pdf && false)
$(BIBTEX) main.aux || (rm -f main.pdf && false)
$(LATEX) main.tex || (rm -f main.pdf && false)
$(LATEX) main.tex || (rm -f main.pdf && false)
$(LATEX) main.tex || (rm -f main.pdf && false)
$(RERUN) main.log
$(UNDEFINED) main.log
%.pdf: %.svg
inkscape -T -z -A $@ $<
IGNORE = \
*.aux \
*/*.aux \
main.aux \
main.bbl \
main.blg \
main.brf \
main.lof \
main.log \
main.lot \
main.pdf \
main.out \
main.toc \
$(FIGGENPDF)
.PHONY: clean
clean:
rm -f $(IGNORE)
.PHONY: .gitignore
.gitignore:
echo .gitignore $(IGNORE) | sed 's/ /\n/g' > .gitignore
# The following target is useful for debugging Makefiles; it
# prints the value of a make variable.
print-%:
@echo $* = $($*)