blob: f059320ed0b6d055a54b05ab1c671c1a154ee459 (
plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
# Makefile for ThuThesis
# Compiling method: latexmk/xelatex/pdflatex/dvipdfmx
METHOD = latexmk
# Set opts for latexmk if you use it
LATEXMKOPTS = -xelatex
# Basename of thesis
THESISMAIN = main
# Basename of shuji
SHUJIMAIN = shuji
ifeq ($(MAKE),)
override MAKE = make
endif
ifeq ($(TEXI2DVI),)
override TEXI2DVI = texi2dvi
endif
PACKAGE=thuthesis
SOURCES=$(PACKAGE).ins $(PACKAGE).dtx
THESISCONTENTS=$(THESISMAIN).tex data/*.tex $(EPS)
# NOTE: update this to reflect your local file types.
EPS=$(wildcard figures/*.eps)
BIBFILE=ref/*.bib
SHUJICONTENTS=$(SHUJIMAIN).tex
CLSFILES=dtx-style.sty $(PACKAGE).cls $(PACKAGE).cfg
# make deletion work on Windows
ifdef SystemRoot
RM = del /Q
SLASH = \\
else
RM = rm -f
SLASH = /
endif
.PHONY: all clean distclean dist thesis viewthesis shuji viewshuji doc viewdoc cls FORCE_MAKE
all: doc thesis shuji
###### generate cls/cfg
cls: $(CLSFILES)
$(CLSFILES): $(SOURCES)
latex $(PACKAGE).ins
###### for doc
viewdoc: doc
open $(PACKAGE).pdf
doc: $(PACKAGE).pdf
ifeq ($(METHOD),xelatex)
$(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
else ifeq ($(METHOD),pdflatex)
$(PACKAGE).pdf: $(CLSFILES)
pdflatex $(PACKAGE).dtx
makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
pdflatex $(PACKAGE).dtx
pdflatex $(PACKAGE).dtx
else ifeq ($(METHOD),latexmk)
$(PACKAGE).pdf: $(CLSFILES) FORCE_MAKE
latexmk $(LATEXMKOPTS) $(PACKAGE).dtx
else
$(PACKAGE).dvi: $(CLSFILES)
latex $(PACKAGE).dtx
makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
latex $(PACKAGE).dtx
latex $(PACKAGE).dtx
$(PACKAGE).pdf: $(PACKAGE).dvi
latex $(PACKAGE).dtx
dvipdfmx $(PACKAGE).dvi
endif
###### for thesis
viewthesis: thesis
open $(THESISMAIN).pdf
thesis: $(THESISMAIN).pdf
ifeq ($(METHOD),xelatex)
$(THESISMAIN).pdf: $(CLSFILES) $(THESISCONTENTS) $(THESISMAIN).bbl
xelatex $(THESISMAIN).tex
xelatex $(THESISMAIN).tex
$(THESISMAIN).bbl: $(BIBFILE)
xelatex $(THESISMAIN).tex
-bibtex $(THESISMAIN)
$(RM) $(THESISMAIN).pdf
else ifeq ($(METHOD),pdflatex)
$(THESISMAIN).pdf: $(CLSFILES) $(THESISCONTENTS) $(THESISMAIN).bbl
pdflatex $(THESISMAIN).tex
pdflatex $(THESISMAIN).tex
$(THESISMAIN).bbl: $(BIBFILE)
pdflatex $(THESISMAIN).tex
-bibtex $(THESISMAIN)
$(RM) $(THESISMAIN).pdf
else ifeq ($(METHOD),latexmk)
$(THESISMAIN).pdf: $(CLSFILES) FORCE_MAKE
latexmk $(LATEXMKOPTS) $(THESISMAIN)
else
$(THESISMAIN).pdf: $(THESISMAIN).dvi
latex $(THESISMAIN).tex
dvipdfmx $(THESISMAIN).dvi
$(THESISMAIN).dvi: $(CLSFILES) $(THESISCONTENTS) $(THESISMAIN).bbl
$(TEXI2DVI) $(THESISMAIN).tex
$(THESISMAIN).bbl: $(BIBFILE)
$(TEXI2DVI) $(THESISMAIN).tex
-bibtex $(THESISMAIN)
endif
###### for shuji
viewshuji: shuji
open $(SHUJIMAIN).pdf
shuji: $(SHUJIMAIN).pdf
ifeq ($(METHOD),xelatex)
$(SHUJIMAIN).pdf: $(CLSFILES) $(SHUJICONTENTS)
xelatex $(SHUJIMAIN).tex
else ifeq ($(METHOD),pdflatex)
$(SHUJIMAIN).pdf: $(CLSFILES) $(SHUJICONTENTS)
pdflatex $(SHUJIMAIN).tex
else ifeq ($(METHOD),latexmk)
$(SHUJIMAIN).pdf: $(CLSFILES) FORCE_MAKE
latexmk $(LATEXMKOPTS) $(SHUJIMAIN)
else
$(SHUJIMAIN).dvi: $(CLSFILES) $(SHUJICONTENTS)
$(TEXI2DVI) $(SHUJIMAIN).tex
$(SHUJIMAIN).pdf: $(SHUJIMAIN).dvi
latex $(SHUJIMAIN).tex
dvipdfmx $(SHUJIMAIN).dvi
endif
clean:
latexmk -c $(PACKAGE).dtx $(THESISMAIN) $(SHUJIMAIN)
-@$(RM) $(PACKAGE).dvi $(THESISMAIN).dvi $(SHUJIMAIN).dvi
-@$(RM) *~
cleanall: clean
-@$(RM) $(PACKAGE).pdf $(THESISMAIN).pdf $(SHUJIMAIN).pdf
distclean: cleanall
-@$(RM) $(CLSFILES)
-@$(RM) -r dist
dist:
@if [ -z "$(version)" ]; then \
echo "Usage: make dist version=[x.y.z | ctan]"; \
else \
gulp build --version=$(version); \
fi
|