-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
82 lines (81 loc) · 2.13 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
DVIPDFMX:=$(shell grep '\\def\\usewhat{dvipdfmx}' main.tex)
PDFLATEX:=$(shell grep '\\def\\usewhat{pdflatex}' main.tex)
DVIPSPDF:=$(shell grep '\\def\\usewhat{dvipspdf}' main.tex)
YAP:=$(shell grep '\\def\\usewhat{yap}' main.tex)
XELATEX :=$(shell grep '\\def\\usewhat{xelatex}' main.tex)
empty=
all:
ifneq ($(empty),$(XELATEX))
@echo Making xelatex......
xelatex main.tex
xelatex main.tex
bibtex main
xelatex main.tex
@echo Done. Starting the browser......
acroread main_xelatex.pdf&
endif
ifneq ($(empty),$(DVIPDFMX))
@echo Making dvipdfmx......
rm -f main.pdf main.dvi &
latex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
latex main.tex
dvipdfmx -p a4 main.dvi
@echo Done. Starting the browser......
acroread main.pdf&
endif
ifneq ($(empty),$(PDFLATEX))
@echo Making pdflatex......
rm -f main_pdflatex.pdf&
pdflatex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
pdflatex main.tex
pdflatex main.tex
mv main.pdf main_pdflatex.pdf
@echo Done. Starting the browser......
acroread main_pdflatex.pdf&
endif
ifneq ($(empty),$(DVIPSPDF))
@echo Making dvipspdf......
rm -f main_dvipspdf.pdf main.dvi main.ps&
latex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
latex main.tex
dvips -G0 -ta4 main.dvi
ps2pdf main.ps main_dvipspdf.pdf
@echo Done. Starting the browser......
acroread main_dvipspdf.pdf&
endif
ifneq ($(empty),$(YAP))
@echo Making dvi......
rm -f main.dvi&
latex main.tex
env BIBINPUTS=./ BSTINPUTS=./ bibtex main
latex main.tex
latex main.tex
xdvi main.dvi&
endif
clean:
@echo Cleaning up......
-find -name '*.aux' -exec rm -f {} \;
-find -name '*.bak' -exec rm -f {} \;
-find -name '*.dvi' -exec rm -f {} \;
-find -name '*~' -exec rm -f {} \;
-find -name '#*#' -exec rm -f {} \;
-find -name 'semantic.cache' -exec rm -f {} \;
-find -name '*.log' -exec rm -f {} \;
-rm -f *.bbl *.blg *.log *.out *.ps *.thm *.toc *.toe *.lof *.lot
-rm -f *.loa *.aen
-rm -f *.html *.css *.scm *.hlog
-rm -f _region_.tex
-rm -f -rf auto
-rm -f *.fen
-rm -f *.ten
-rm -rf ./body/auto
-rm -rf ./reference/auto
-rm -rf ./setup/auto
-rm -rf ./preface/auto
-rm -rf *.prv
@echo All done.