-
Notifications
You must be signed in to change notification settings - Fork 150
/
Makefile
97 lines (80 loc) · 2.09 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
###############################################################################
#
# Makefile for njuthesis
#
# Copyright (C) 2013-2015 Haixing Hu,
# Department of Computer Science and Technology, Nanjing University.
#
# Home Page of the Project: http://haixing-hu.github.io/nju-thesis/
#
###############################################################################
PACKAGE=njuthesis
BST_FILE=gbt7714-2005.bst
BST_URL=https://raw.githubusercontent.com/Haixing-Hu/GBT7714-2005-BibTeX-Style/master/gbt7714-2005.bst
SOURCES=$(PACKAGE).dtx $(PACKAGE).ins
CLS=$(PACKAGE).cls $(PACKAGE).cfg dtx-style.sty
SAMPLE=sample
SAMPLECONTENTS=$(SAMPLE).tex
SAMPLEBIB=$(SAMPLE).bib
INSTITUTE_LOGO=njulogo.eps
INSTITUTE_NAME=njuname.eps
TEXMFLOCAL=$(shell get_texmf_dir.sh)
.PHONY: all clean cls doc sample
all: bst cls doc sample
###### update bst file
bst: $(BST_FILE)
$(BST_FILE):
curl $(BST_URL) -o $(BST_FILE)
###### generate cls/cfg
cls: $(CLS)
$(CLS): $(SOURCES)
latex $(PACKAGE).ins
###### generate doc
doc: $(PACKAGE).pdf
$(PACKAGE).pdf: $(CLS)
xelatex $(PACKAGE).dtx
makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
xelatex $(PACKAGE).dtx
xelatex $(PACKAGE).dtx
###### for sample
sample: $(SAMPLE).pdf
$(SAMPLE).pdf: $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(BST_FILE) $(SAMPLE).tex $(SAMPLEBIB)
xelatex $(SAMPLE).tex
bibtex $(SAMPLE)
xelatex $(SAMPLE).tex
xelatex $(SAMPLE).tex
###### install
install: $(SOURCE) $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(BST_FILE) $(PACKAGE).pdf $(SAMPLE).pdf
mkdir -p $(TEXMFLOCAL)/tex/latex/njuthesis
cp -rvf $(SOURCES) $(CLS) $(INSTITUTE_LOGO) $(INSTITUTE_NAME) $(TEXMFLOCAL)/tex/latex/njuthesis/
mkdir -p $(TEXMFLOCAL)/doc/latex/njuthesis
cp -rvf $(PACKAGE).pdf $(SAMPLE).pdf $(TEXMFLOCAL)/doc/latex/njuthesis/
mkdir -p $(TEXMFLOCAL)/bibtex/bst
cp -rvf $(BST_FILE) $(TEXMFLOCAL)/bibtex/bst/
texhash
###### clean
clean:
-@rm -f \
*.aux \
*.bak \
*.bbl \
*.blg \
*.dvi \
*.glo \
*.gls \
*.idx \
*.ilg \
*.ind \
*.ist \
*.log \
*.out \
*.ps \
*.thm \
*.toc \
*.lof \
*.lot \
*.loe \
*.sty \
*.cfg \
*.cls \
*.sty