-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (37 loc) · 850 Bytes
/
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
NAME = keyvaltable
SRC = $(NAME).dtx
INS = $(NAME).ins
PKG = $(NAME).sty
DOC = $(NAME).pdf
README = README.md
CTAN = $(SRC) $(INS) $(DOC) $(README)
ifeq (, $(shell which lualatex))
LTX = pdflatex
else
LTX = lualatex
endif
all: package docs
.PHONY: all package docs clean cleanall ctan
package: $(PKG)
docs: $(DOC)
$(PKG): $(SRC) $(INS)
latex $(INS)
$(DOC): $(SRC) $(PKG)
ifeq (, $(shell which latexmk))
$(LTX) $(SRC)
makeindex -s gind.ist -o $(NAME).ind $(NAME).idx
makeindex -s gglo.ist -o $(NAME).gls $(NAME).glo
$(LTX) $(SRC)
$(LTX) $(SRC)
else
latexmk $(SRC)
endif
ctan: $(CTAN)
mkdir $(NAME)
cp $(CTAN) $(NAME)/
zip -r $(NAME)-$(shell date "+%Y-%m-%d").zip $(NAME)
rm -rf $(NAME)
clean:
rm -f $(NAME).{aux,fls,fdb_latexmk,glo,gls,hd,idx,ilg,ind,log,out,toc,tmp}
cleanall: clean
rm -f $(NAME).{pdf,sty}