forked from zepinglee/gbt7714-bibtex-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (44 loc) · 1.42 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
.PHONY : test testall save bst versions doc clean all inst install distclean zip FORCE_MAKE
NAME = gbt7714
PKGFILES = $(NAME).sty
BSTFILES = $(NAME)-plain.bst $(NAME)-unsrt.bst
TESTDIR = test
SHELL = bash
LATEXMK = latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode
VERSION = $(shell cat $(NAME).dtx | egrep -o "\[\d\d\d\d/\d\d\/\d\d v.+\]" \
| egrep -o "v\S+")
TEXMF = $(shell kpsewhich --var-value TEXMFHOME)
test : bst
bash check.sh
testall : test
texlua build.lua check
save :
bash check.sh
texlua build.lua save --quiet super
texlua build.lua save --quiet numbers
texlua build.lua save --quiet authoryear
all : test doc
bst : $(PKGFILES) $(BSTFILES)
doc : $(NAME).pdf
%.sty %-plain.bst %-unsrt.bst : %.dtx
xetex $<
$(NAME).pdf : $(NAME).dtx FORCE_MAKE
$(LATEXMK) -xelatex -halt-on-error -interaction=nonstopmode $<
clean :
$(LATEXMK) -c $(NAME).dtx
$(MAKE) -C $(TEST_DIR) clean
distclean :
$(LATEXMK) -C $(NAME).dtx
$(MAKE) -C $(TEST_DIR) distclean
install : bst 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 $(NAME).dtx $(TEXMF)/source/latex/$(NAME)
cp $(PKGFILES) $(TEXMF)/tex/latex/$(NAME)
ctan : bst doc
ln -sf . $(NAME)
zip -r ../$(NAME).zip $(NAME)/{README.md,LICENSE,$(NAME).dtx,\
$(NAME).pdf,$(NAME).sty,$(NAME)-plain.bst,$(NAME)-unsrt.bst}
rm $(NAME)