-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathMakefile
99 lines (80 loc) · 1.73 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Makefile for UCASThesis
# $Id$
include config.mk
ifeq ($(MAKE),)
override MAKE = make
endif
ifeq ($(TEXI2DVI),)
override TEXI2DVI = texi2dvi
endif
PACKAGE=ucasthesis
SOURCES=$(PACKAGE).ins $(PACKAGE).dtx
THESISCONTENTS=$(THESISMAIN).tex data/*.tex $(EPS) $(EPSGEN)
EPS=$(wildcard figures/*.eps)
EPSGEN=
# xelatex can directly use jpg file
ifneq ($(METHOD),xelatex)
EPSGEN+=$(addsuffix .eps,$(basename $(wildcard figures/*.jpg)))
endif
EPSGEN+=$(addsuffix .eps,$(basename $(wildcard figures/*.fig)))
BIBFILE=ref/*.bib
SPINECONTENTS=$(SPINEMAIN).tex
CLSFILES=dtx-style.sty $(PACKAGE).cls $(PACKAGE).cfg
.PHONY: all clean distclean dist thesis spine doc cls
all: doc thesis spine
###### generate cls/cfg
cls: $(CLSFILES)
$(CLSFILES): $(SOURCES)
latex $(PACKAGE).ins
###### for doc
doc: $(PACKAGE).pdf
$(PACKAGE).pdf: $(CLSFILES)
xelatex $(PACKAGE).dtx
makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
xelatex $(PACKAGE).dtx
xelatex $(PACKAGE).dtx
###### for thesis
thesis: $(THESISMAIN).pdf
$(THESISMAIN).pdf: $(CLSFILES) $(THESISCONTENTS)
xelatex $(THESISMAIN).tex
biber $(THESISMAIN)
xelatex $(THESISMAIN).tex
xelatex $(THESISMAIN).tex
figures/%.eps: figures/%.jpg
convert $^ -compress none eps2:$@
figures/%.eps: figures/%.fig
fig2dev -L eps $^ $@
###### for spine
spine: $(SPINEMAIN).pdf
$(SPINEMAIN).pdf: $(CLSFILES) $(SPINECONTENTS)
xelatex $(SPINEMAIN).tex
clean:
-@rm -f \
*~ \
*.aux \
*.bak \
*.bbl \
*.blg \
*.dvi \
*.glo \
*.gls \
*.idx \
*.ilg \
*.ind \
*.ist \
*.log \
*.out \
*.ps \
*.thm \
*.toc \
*.lof \
*.lot \
*.loe \
*.bcf \
*.xml \
*.fls \
*.fdb_latexmk \
data/*.aux \
$(EPSGEN) \
dtx-style.sty