-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
53 lines (47 loc) · 1.49 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
# variables
## package base name
CONTRIBUTION = menukeys
## final ZIP file name
ZIP = ${CONTRIBUTION}.zip
## cleanup command
CLEANUP = find . -type f -regextype posix-extended -regex "\./${CONTRIBUTION}(.?|-doc)\.(aux|glo|gls|hd|idx|ilg|ind|lof|log|lot|out|toc)" -delete
## TeX-engine to use
TEX = /usr/local/texlive/2021/bin/x86_64-linux/pdflatex
## if it doesn't exist fall back to any pdflatex
ifeq ("$(wildcard ${TEX})","")
TEX = pdflatex
endif
## temporary build directory
BUILD := ${CONTRIBUTION}
all: ${ZIP}
# generate ZIP
${ZIP}: ${CONTRIBUTION}.pdf README
# ZIP
mkdir ${CONTRIBUTION}
cp ${CONTRIBUTION}.dtx ${CONTRIBUTION}.ins ${CONTRIBUTION}.pdf README ${CONTRIBUTION}
zip ${CONTRIBUTION}.zip ./${CONTRIBUTION}/*
rm -r ${CONTRIBUTION}
# generate *.sty files
%.sty: ${CONTRIBUTION}.ins ${CONTRIBUTION}.dtx
latex $<
# generate documentation file
${CONTRIBUTION}.pdf: ${CONTRIBUTION}.dtx ${CONTRIBUTION}.sty
# tidy up
$(CLEANUP)
# generate doc
${TEX} ${CONTRIBUTION}.dtx
${TEX} ${CONTRIBUTION}.dtx
makeindex -s gglo.ist -o ${CONTRIBUTION}.gls ${CONTRIBUTION}.glo
makeindex -s l3doc.ist -o ${CONTRIBUTION}.ind ${CONTRIBUTION}.idx
${TEX} ${CONTRIBUTION}.dtx
${TEX} ${CONTRIBUTION}.dtx
clean-most:
$(CLEANUP)
clean-pdf:
find . -type f -regextype posix-extended -regex "\./${CONTRIBUTION}(.?|-doc)\.pdf" -delete
clean-sty:
-rm ${CONTRIBUTION}.sty ${CONTRIBUTION}-20*.sty
clean-zip:
-rm ${ZIP}
clean: clean-most clean-pdf clean-sty clean-zip
.PHONY: clean clean-most clean-pdf clean-sty clean-zip all