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
|
STYLE = bath
NAME = biblatex-$(STYLE)
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: $(NAME).pdf clean
@exit 0
source: $(NAME).dtx
luatex -interaction=batchmode $(NAME).dtx >/dev/null
$(STYLE).bbx $(STYLE).cbx $(STYLE).dbx english-$(STYLE).lbx british-$(STYLE).lbx $(NAME).bib: source
$(NAME).pdf: source
latexmk -silent -lualatex -interaction=batchmode $(NAME).dtx >/dev/null
@echo "Compilation complete."
clean:
rm -f $(NAME).{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).markdown.in
rm -rf _markdown_$(NAME)
distclean: clean
rm -f $(NAME).{pdf,bib,ins} $(STYLE).{b,c,d}bx {english,british}-$(STYLE).lbx
inst: all
mkdir -p $(UTREE)/{source,tex,doc}/latex/$(NAME)
cp $(NAME).dtx $(NAME).ins $(UTREE)/source/latex/$(NAME)
cp $(NAME).{bib,pdf} $(UTREE)/doc/latex/$(NAME)
cp $(STYLE).{b,c,d}bx {english,british}-$(STYLE).lbx $(UTREE)/tex/latex/$(NAME)
mktexlsr
uninst:
rm -r $(UTREE)/{source,tex,doc}/latex/$(NAME)
mktexlsr
install: all
sudo mkdir -p $(LOCAL)/{source,tex,doc}/latex/$(NAME)
sudo cp $(NAME).dtx $(NAME).ins $(LOCAL)/source/latex/$(NAME)
sudo cp $(NAME).{bib,pdf} $(LOCAL)/doc/latex/$(NAME)
sudo cp $(STYLE).{b,c,d}bx {english,british}-$(STYLE).lbx $(LOCAL)/tex/latex/$(NAME)
mktexlsr
uninstall:
sudo rm -r $(LOCAL)/{source,tex,doc}/latex/$(NAME)
mktexlsr
zip: all
mkdir $(TDIR)
cp $(NAME).{dtx,bib,pdf} $(STYLE).{b,c,d}bx {english,british}-$(STYLE).lbx README.md Makefile $(TDIR)
cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)
ctan: all
mkdir $(TDIR)
cp $(NAME).{dtx,pdf} README.md Makefile $(TDIR)
cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)
|