forked from sjtug/SJTUThesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.19 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
# Makefile for sjtu-thesis-template-latex
# SED tool
SED = gsed
# Option for latexmk
LATEX_OPT = -xelatex -silent -f
# Basename of thesis
THESISMAIN = diss
# Test file
TESTFILE = temptest
# pdf viewer: evince/open
VIEWER = open
# version number, which can be specified when calling make like
# make VERSION="0.5.2"
VERSION = 0.5.3
all: $(THESISMAIN).pdf
.PHONY : all clean version distclean cleantest release
$(THESISMAIN).pdf : $(THESISMAIN).tex body/*.tex reference/*.bib *.cls *.cfg
-latexmk $(LATEX_OPT) $(THESISMAIN)
view : $(THESISMAIN).pdf
$(VIEWER) $< &
clean :
latexmk -C
distclean : clean
-@rm -f $(THESISMAIN).pdf
test : $(TESTFILE).pdf
$(TESTFILE).pdf : $(TESTFILE).tex
latexmk $(LATEX_OPT) $(TESTFILE) > /dev/null
$(VIEWER) $@
cleantest :
-@rm $(TESTFILE).pdf
cp : $(THESISMAIN).pdf
-@cp -f $< README.pdf
version :
$(SED) -i "s/templateversion{v.*}/templateversion{v$(VERSION)}/g" sjtuthesis.cfg
$(SED) -i "s/bachelor-.*zip/bachelor-$(VERSION).zip/g" body/chapter01.tex
$(SED) -i "s/master-.*zip/master-$(VERSION).zip/g" body/chapter01.tex
$(SED) -i "s/phd-.*zip/phd-$(VERSION).zip/g" body/chapter01.tex
release : clean version all cp
@echo "OK. Release version $(VERSION)."