diff options
author | Robert Alessi <alessi@robertalessi.net> | 2020-07-07 20:01:29 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2020-07-07 20:01:29 +0200 |
commit | c9af7edd0f17df1c495669227256bfe947736685 (patch) | |
tree | d3de6aefb7a635d19a8e53da381e4bae99a284ce /Makefile | |
parent | e18561ecc00ac0336507daedd2d7e9e352a04251 (diff) | |
download | ekdosis-c9af7edd0f17df1c495669227256bfe947736685.tar.gz |
added samples directory
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 39 |
1 files changed, 28 insertions, 11 deletions
@@ -8,17 +8,31 @@ UTREE = $(shell kpsewhich --var-value TEXMFHOME) | |||
8 | HOMEDIR := $$HOME | 8 | HOMEDIR := $$HOME |
9 | 9 | ||
10 | exts := md html ins dtx el | 10 | exts := md html ins dtx el |
11 | texsamples := $(basename $(wildcard $(PWD)/samples/*.tex)) | ||
12 | texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex))) | ||
11 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") | 13 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") |
12 | 14 | ||
15 | define 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 | ||
20 | endef | ||
21 | |||
13 | all: sty $(NAME).pdf | 22 | all: sty $(NAME).pdf |
14 | 23 | ||
15 | sty: clean | 24 | sty: 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 | ||
43 | samples: 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 | |||
29 | clean: | 48 | clean: |
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 | ||
61 | local: uninst auctex | 81 | local: 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 | ||
72 | zip: all | 87 | zip: 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 | ||
77 | package: distclean all | 92 | package: 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 |