-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·186 lines (146 loc) · 3.25 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
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
# Makefile for ThuThesis
# $Id: Makefile 99 2006-06-21 08:05:44Z littleleo $
SRCPATH = fig plot
MAKEFUNC = @MakeSubDir() \
{ \
for DIR in `ls|grep -v 'include'|grep -v 'lib'|grep -v 'bin'| grep -v 'include'`; do \
if [ -d $${DIR} ]; then \
cd $${DIR}; \
MakeSubDir; \
if [ -f makefile -o -f Makefile ]; then \
echo ""; \
pwd; \
make $(1); \
if [ "$$?" != "0" ]; then \
exit 1; \
fi; \
fi; \
cd ..; \
fi; \
done; \
if [ -f makefile -o -f Makefile ]; then \
echo ""; \
pwd; \
make $(1); \
if [ "$$?" != "0" ]; then \
exit 1; \
fi; \
fi; \
}; \
MAKEME = cd $(2); MakeSubDir $(1); cd ..;
LOOPMAKEFUNC = $(MAKEFUNC) $(foreach dir,$(SRCPATH),$(call MAKEME,$(1),$(dir)))
ifeq ($(MAKE),)
override MAKE=make
endif
ifeq ($(TEXI2DVI),)
override TEXI2DVI=texi2dvi
endif
ifneq ($(METHOD),ps2pdf)
ifneq ($(METHOD),dvipdfm)
override METHOD=ps2pdf
endif
endif
PACKAGE=zjuthesis
SOURCES=$(PACKAGE).ins $(PACKAGE).dtx
THESISMAIN=main
THESISCONTENTS=$(THESISMAIN).tex data/*.tex
BIBFILE=$(PACKAGE).bib
#SHUJIMAIN=shuji
#SHUJICONTENTS=$(SHUJIMAIN).tex
.PHONY: all clean distclean all doc cls cfg dvi ps pdf
all: doc-pdf
###### generate cls/cfg
#cls: $(PACKAGE).cls
#$(PACKAGE).cls: $(SOURCES)
# rm -f $(PACKAGE).cls $(PACKAGE).cfg
# elatex $(PACKAGE).ins
###### for doc
doc: selectable
doc-pdf: $(PACKAGE).pdf
pro: zjuproposal.pdf
#doc-dvi: $(PACKAGE).dvi
#doc-ps: $(PACKAGE).ps
#$(PACKAGE).dvi: $(PACKAGE).bbl
# latex $(PACKAGE).tex
$(PACKAGE).pdf: *.tex *.bib
latex $(PACKAGE)
bibtex $(PACKAGE)
latex $(PACKAGE)
gbk2uni $(PACKAGE)
latex $(PACKAGE)
evince $(PACKAGE).pdf
zjuproposal.pdf: proposalcontents.tex zjuproposal.tex proposalcover.tex
latex zjuproposal
bibtex zjuproposal
latex zjuproposal
gbk2uni zjuproposal
latex zjuproposal
evince zjuproposal.pdf
selectable: *.tex *.bib
elatex $(PACKAGE).tex
bibtex $(PACKAGE)
elatex $(PACKAGE).tex
gbk2uni $(PACKAGE)
elatex $(PACKAGE).tex
dvipdfmx $(PACKAGE).dvi
evince $(PACKAGE).pdf
#dvips -Ppdf -G0 $(PACKAGE).dvi
$(PACKAGE).bbl: $(BIBFILE)
$(TEXI2DVI) $(PACKAGE).tex
bibtex $(PACKAGE)
###### for thesis
thesis: thesis-pdf
thesis-pdf: $(THESISMAIN).pdf
thesis-dvi: $(THESISMAIN).dvi
thesis-ps: $(THESISMAIN).ps
$(THESISMAIN).dvi: $(THESISCONTENTS) $(THESISMAIN).bbl
$(TEXI2DVI) $(THESISMAIN).tex
ifeq ($(METHOD),dvipdfm)
$(THESISMAIN).pdf: $(THESISMAIN).dvi
gbk2uni $(THESISMAIN)
latex $(THESISMAIN).tex
dvipdfm $(THESISMAIN).dvi
else
$(THESISMAIN).pdf: $(THESISMAIN).ps
ps2pdf $(THESISMAIN).ps
endif
$(THESISMAIN).ps: $(THESISMAIN).dvi
gbk2uni $(THESISMAIN)
latex $(THESISMAIN).tex
dvips -Ppdf -G0 $(THESISMAIN).dvi
$(THESISMAIN).bbl: $(BIBFILE)
$(TEXI2DVI) $(THESISMAIN).tex
-bibtex $(THESISMAIN)
clean:
-@rm -f \
*.aux \
*.bak \
*.bbl \
*.blg \
*.cls \
*.cfg \
*.dvi \
*.glo \
*.gls \
*.idx \
*.ilg \
*.ind \
*.ist \
*.log \
*.out \
*.ps \
*.thm \
*.toc \
*.lof \
*.lot \
*.loe \
*.pdf \
data/*.aux
distclean: clean
-@rm -f *.pdf *.tar.gz
dist:
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make dist VERSION=<version#>"; \
else \
./makedist.sh $(VERSION); \
fi