aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 28 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 3e83202..4ae326e 100644
--- a/Makefile
+++ b/Makefile
@@ -8,17 +8,31 @@ UTREE = $(shell kpsewhich --var-value TEXMFHOME)
8HOMEDIR := $$HOME 8HOMEDIR := $$HOME
9 9
10exts := md html ins dtx el 10exts := md html ins dtx el
11texsamples := $(basename $(wildcard $(PWD)/samples/*.tex))
12texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex)))
11findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") 13findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)")
12 14
15define dosamples
16 $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null
17 $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null
18 $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null
19 $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null
20endef
21
13all: sty $(NAME).pdf 22all: sty $(NAME).pdf
14 23
15sty: clean 24sty: clean
16 $(CMP) $(NAME).ins 25 $(CMP) $(NAME).ins >/dev/null
17 26
18$(NAME).pdf: $(NAME).dtx 27$(NAME).pdf: $(NAME).dtx
19# $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME)-ex.tex >/dev/null 28 @ echo "Make the sample files first..."
29 if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi
30 $(foreach file,$(texsamples), $(call dosamples, $(file)))
31 mv TMP/*.pdf samples/
32 mv $(texsamplesout)-tei.xml samples/
33 @ echo "Build the documentation of $(NAME)..."
20 $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null 34 $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null
21 biber $(NAME) 35 biber $(NAME) >/dev/null
22 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi 36 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
23 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi 37 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
24 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 38 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
@@ -26,13 +40,18 @@ $(NAME).pdf: $(NAME).dtx
26 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 40 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
27 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 41 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
28 42
43samples: clean sty
44 if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi
45 $(foreach file,$(texsamples), $(call dosamples, $(file)))
46 mv TMP/*{\.pdf,-tei\.xml} samples/
47
29clean: 48clean:
30 rm -rf auto 49 rm -rf auto
31 rm -f $(NAME).bib $(PWD)/TMP/*.bib 50 rm -f $(NAME).bib $(PWD)/TMP/*.bib
32 rm -rf .backup 51 rm -rf .backup
33 find -iname "*~" -or -iname "*.pdf" | xargs rm -rf 52 find -iname "*~" -or -iname "*.pdf" | xargs rm -rf
34 find ./* -type f -iname "Makefile" $(findopts) > ls-R 53 find ./* -type f -iname "Makefile" $(findopts) > ls-R
35# find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R 54 find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R
36 rsync -avPr --files-from=ls-R . .backup 55 rsync -avPr --files-from=ls-R . .backup
37 rm -rf * 56 rm -rf *
38 cp -p -r .backup/* . 57 cp -p -r .backup/* .
@@ -57,30 +76,28 @@ inst: uninst auctex all
57 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) 76 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME)
58 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) 77 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME)
59 cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) 78 cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME)
79 cp -r samples/ $(UTREE)/doc/latex/$(NAME)
60 80
61local: uninst auctex 81local: uninst auctex
62 $(CMP) $(NAME).ins 82 $(CMP) $(NAME).ins
63 mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) 83 mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME)
64 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) 84 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME)
65 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) 85 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME)
66#install: all
67# sudo mkdir -p $(LOCAL)/{tex,source,doc}/lualatex/$(NAME)
68# sudo cp $(NAME).dtx $(LOCAL)/source/lualatex/$(NAME)
69# sudo cp $(NAME).sty $(LOCAL)/tex/lualatex/$(NAME)
70# sudo cp $(NAME).pdf $(LOCAL)/doc/lualatex/$(NAME)
71 86
72zip: all 87zip: all
73 ln -sf . $(NAME) 88 ln -sf . $(NAME)
74 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README.md,$(NAME).{pdf,sty,lua,el}} 89 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{samples,README.md,$(NAME).{pdf,sty,lua,el}}
75 rm $(NAME) 90 rm $(NAME)
76 91
77package: distclean all 92package: distclean all
78 mkdir $(NAME)/ 93 mkdir $(NAME)/
79 cp README.md *.ins *.dtx *.pdf $(NAME)/ 94 cp Makefile README.md $(NAME).{ins,dtx,pdf} $(NAME)/
95 cp -r samples/ $(NAME)/
80 mkdir -p tex/lualatex/$(NAME)/ 96 mkdir -p tex/lualatex/$(NAME)/
81 cp *.lua *.sty tex/lualatex/$(NAME)/ 97 cp *.lua *.sty tex/lualatex/$(NAME)/
82 mkdir -p doc/lualatex/$(NAME)/ 98 mkdir -p doc/lualatex/$(NAME)/
83 cp README.md *.el *.pdf doc/lualatex/$(NAME)/ 99 cp README.md *.el *.pdf doc/lualatex/$(NAME)/
100 cp -r samples/ doc/lualatex/$(NAME)/
84 mkdir -p source/lualatex/$(NAME)/ 101 mkdir -p source/lualatex/$(NAME)/
85 cp Makefile *.ins *.dtx source/lualatex/$(NAME)/ 102 cp Makefile *.ins *.dtx source/lualatex/$(NAME)/
86 zip -r $(NAME).tds.zip tex doc source 103 zip -r $(NAME).tds.zip tex doc source