-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
53 lines (39 loc) · 1.3 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
# Rolf Niepraschk, 2017-03-17, [email protected]
.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
CLASS = leaflet
PDFLATEX = pdflatex
TEX = tex
LATEX = latex
VERSION = $(shell awk -F"[{}]" '/fileversion/ {print $$2}' leaflet.dtx)
DIST_DIR = leaflet
DIST_FILES = leaflet.dtx leaflet.ins leaflet.pdf leaflet-manual.pdf README.md
ARCHNAME = $(CLASS)-$(VERSION).zip
all : leaflet.cls leaflet.pdf leaflet-manual.pdf
leaflet.cls leaflet-manual.tex: leaflet.dtx
$(TEX) $(basename $<).ins
leaflet-manual.pdf : leaflet-manual.tex leaflet.cls
$(PDFLATEX) $<
leaflet.pdf : leaflet.dtx
if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi
if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi
makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \
$(basename $<).glo
makeindex -s gind.ist -t $(basename $<).ilg -o $(basename $<).ind \
$(basename $<).idx
$(PDFLATEX) $<
$(PDFLATEX) $<
README : README.md
cat $< | awk '/^```/ {$$0=""} \
/is also/ {exit} \
{print}' > $@
dist : $(DIST_FILES)
mkdir -p $(DIST_DIR)
cp -p $+ $(DIST_DIR)
zip $(ARCHNAME) -r $(DIST_DIR)
rm -rf $(DIST_DIR)
clean :
$(RM) *.aux *.log *.glg *.glo *.gls *.idx *.ilg *.ind *.toc
veryclean : clean
$(RM) leaflet.pdf leaflet-manual.pdf leaflet.cls README $(ARCHNAME)
debug :
@echo $(ARCHNAME)