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
|
NAME = bath-bst
BST1 = bath.bst
BST2 = bathx.bst
SHELL = bash
PWD = $(shell pwd)
TEMP := $(shell mktemp -d -t tmp.XXXXXXXXXX)
TDIR = $(TEMP)/$(NAME)
VERS = $(shell ltxfileinfo -v $(NAME).dtx)
LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
UTREE = $(shell kpsewhich --var-value TEXMFHOME)
.PHONY: source clean distclean inst install uninst uninstall zip ctan
all: $(BST1) $(BST2) $(NAME)-v1.pdf $(NAME).pdf clean
@exit 0
source: $(BST1) $(BST2) $(NAME).bib $(NAME)-v1.tex $(NAME)-v1.bib
$(BST1) $(BST2) $(NAME).bib $(NAME)-v1.tex $(NAME)-v1.bib: $(NAME).dtx
luatex -interaction=batchmode $(NAME).dtx >/dev/null
$(NAME).aux: $(NAME).dtx $(NAME).bib
lualatex -interaction=batchmode $< >/dev/null
$(NAME).bbl: $(NAME).aux $(BST2) $(NAME).bib
bibtex $(NAME) >/dev/null
$(NAME).pdf: $(NAME).dtx $(NAME).bbl
latexmk -silent -lualatex -interaction=batchmode $< >/dev/null
@echo "Compilation of main PDF complete."
$(NAME)-v1.aux: $(NAME)-v1.tex $(NAME)-v1.bib
lualatex -interaction=batchmode $< >/dev/null
$(NAME)-v1.bbl: $(NAME)-v1.aux $(BST1) $(NAME)-v1.bib
bibtex $(NAME)-v1 >/dev/null
$(NAME)-v1.pdf: $(NAME)-v1.tex $(BST1) $(NAME)-v1.bbl
latexmk -silent -lualatex -interaction=batchmode $< >/dev/null
@echo "Compilation of test PDF complete."
clean:
rm -f $(NAME){,-v1}.{aux,bbl,bcf,blg,doc,fdb_latexmk,fls,glo,gls,hd,idx,ilg,ind,listing,log,nav,out,run.xml,snm,synctex.gz,tcbtemp,toc,vrb}
rm -f $(NAME){,-v1}.markdown.in
rm -rf _markdown_$(NAME)
distclean: clean
rm -f $(NAME).{pdf,bib,ins} $(BST1) $(BST2) $(NAME)-v1.{pdf,bib,tex}
inst: all
mkdir -p $(UTREE)/{source,doc}/bibtex/$(NAME)
mkdir -p $(UTREE)/bibtex/bst/$(NAME)
cp $(NAME).dtx $(NAME).ins $(UTREE)/source/bibtex/$(NAME)
cp $(NAME).{bib,pdf} $(NAME)-v1.{pdf,bib,tex} $(UTREE)/doc/bibtex/$(NAME)
cp $(BST1) $(BST2) $(UTREE)/bibtex/bst/$(NAME)
mktexlsr
uninst:
rm -r $(UTREE)/{source,doc}/bibtex/$(NAME)
rm -r $(UTREE)/bibtex/bst/$(NAME)
mktexlsr
install: all
sudo mkdir -p $(LOCAL)/{source,doc}/bibtex/$(NAME)
sudo mkdir -p $(LOCAL)/bibtex/bst/$(NAME)
sudo cp $(NAME).dtx $(NAME).ins $(LOCAL)/source/bibtex/$(NAME)
sudo cp $(NAME).{bib,pdf} $(NAME)-v1.{pdf,bib,tex} $(LOCAL)/doc/bibtex/$(NAME)
sudo cp $(BST1) $(BST2) $(LOCAL)/bibtex/bst/$(NAME)
mktexlsr
uninstall:
sudo rm -r $(LOCAL)/{source,doc}/bibtex/$(NAME)
sudo rm -r $(LOCAL)/bibtex/bst/$(NAME)
mktexlsr
zip: all
mkdir $(TDIR)
cp $(NAME).{dtx,bib,pdf} $(NAME)-v1.{pdf,bib,tex} $(BST1) $(BST2) README.md Makefile $(TDIR)
cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)
ctan: all
mkdir $(TDIR)
cp $(NAME).{dtx,pdf} $(NAME)-v1.pdf README.md Makefile $(TDIR)
cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)
|