-
Notifications
You must be signed in to change notification settings - Fork 128
/
Makefile
55 lines (43 loc) · 1001 Bytes
/
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
MAIN=thesis
LATEX=xelatex
BIBTEX=bibtex
RM=rm -f
NTU_WATERMARK_LINK=https://www.lib.ntu.edu.tw/doc/CL/watermark.pdf
.SUFFIXES: .tex
ifdef PASSWORD
all: $(MAIN).pdf $(MAIN)-with-pass.pdf
else
all: $(MAIN).pdf
endif
ifdef WATERMARK
TEXFLAG+="\def\withwatermark{1} "
endif
ifdef DOI
TEXFLAG+="\def\withdoi{1} "
endif
ifdef CERTIFICATION
TEXFLAG+="\def\withcertification{1} "
endif
ifdef FIRSTPAGE
TEXFLAG+="\def\firstpage{1} "
else
TEXFLAG+="\def\excludefirstpage{1} "
endif
TEXFLAG+="\input{$(MAIN)}"
$(MAIN).pdf: *.tex ntuthesis.cls
ifdef WATERMARK
./download.sh $(NTU_WATERMARK_LINK) watermark.pdf
endif
$(LATEX) $(TEXFLAG) $(MAIN)
$(BIBTEX) $(MAIN)
$(LATEX) $(TEXFLAG) $(MAIN)
$(LATEX) $(TEXFLAG) $(MAIN)
ifdef PASSWORD
$(MAIN)-with-pass.pdf: $(MAIN).pdf
pdftk $^ output $@ owner_pw "$(PASSWORD)" allow printing allow ScreenReaders
endif
clean:
$(RM) *.log *.aux *.dvi *.lof *.lot *.toc *.bbl *.blg
clean-pdf:
$(RM) -f $(MAIN).pdf $(MAIN)-with-pass.pdf
clean-all: clean clean-pdf