-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
53 lines (39 loc) · 1.23 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
MAIN = main
NAME = hfutthesis
CLSFILES = $(NAME).cls
BSTFILES = $(NAME)-numerical.bst $(NAME)-graduate.bst
SHELL = bash
LATEXMK = latexmk -xelatex
VERSION = $(shell cat $(NAME).cls | egrep -o "\\hfutthesisversion{v[0-9.]+" \
| egrep -o "v[0-9.]+")
TEXMF = $(shell kpsewhich --var-value TEXMFHOME)
.PHONY : main cls doc test save clean all install distclean zip FORCE_MAKE
main : $(MAIN).pdf
all : main doc
cls : $(CLSFILES) $(BSTFILES)
doc : $(NAME)-doc.pdf
$(MAIN).pdf : $(MAIN).tex $(CLSFILES) $(BSTFILES) FORCE_MAKE
$(LATEXMK) $<
$(NAME)-doc.pdf : $(NAME)-doc.tex FORCE_MAKE
$(LATEXMK) $<
test:
l3build check
save:
bash test/save.sh
clean : FORCE_MAKE
$(LATEXMK) -c $(MAIN).tex $(NAME)-doc.tex
cleanall :
$(LATEXMK) -C $(MAIN).tex $(NAME)-doc.tex
install : cls doc
mkdir -p $(TEXMF)/{doc,source,tex}/latex/$(NAME)
mkdir -p $(TEXMF)/bibtex/bst/$(NAME)
cp $(BSTFILES) $(TEXMF)/bibtex/bst/$(NAME)
cp $(NAME).pdf $(TEXMF)/doc/latex/$(NAME)
cp $(CLSFILES) $(TEXMF)/tex/latex/$(NAME)
zip : main doc
ln -sf . $(NAME)
zip -r ../$(NAME)-$(VERSION).zip $(NAME)/{*.md,LICENSE,\
$(NAME)-doc.tex,$(NAME)-doc.pdf,$(NAME).cls,*.bst,*.bbx,*.cbx,figures,\
$(MAIN).tex,hfutsetup.tex,chapters,bib,$(MAIN).pdf,\
latexmkrc,Makefile}
rm $(NAME)