From c9af7edd0f17df1c495669227256bfe947736685 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 7 Jul 2020 20:01:29 +0200 Subject: added samples directory --- Makefile | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3e83202..4ae326e 100644 --- a/Makefile +++ b/Makefile @@ -8,17 +8,31 @@ UTREE = $(shell kpsewhich --var-value TEXMFHOME) HOMEDIR := $$HOME exts := md html ins dtx el +texsamples := $(basename $(wildcard $(PWD)/samples/*.tex)) +texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex))) findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") +define dosamples + $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null + $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null + $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null + $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null +endef + all: sty $(NAME).pdf sty: clean - $(CMP) $(NAME).ins + $(CMP) $(NAME).ins >/dev/null $(NAME).pdf: $(NAME).dtx -# $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME)-ex.tex >/dev/null + @ echo "Make the sample files first..." + if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi + $(foreach file,$(texsamples), $(call dosamples, $(file))) + mv TMP/*.pdf samples/ + mv $(texsamplesout)-tei.xml samples/ + @ echo "Build the documentation of $(NAME)..." $(CMP) --shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null - biber $(NAME) + biber $(NAME) >/dev/null if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null @@ -26,13 +40,18 @@ $(NAME).pdf: $(NAME).dtx $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null +samples: clean sty + if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi + $(foreach file,$(texsamples), $(call dosamples, $(file))) + mv TMP/*{\.pdf,-tei\.xml} samples/ + clean: rm -rf auto rm -f $(NAME).bib $(PWD)/TMP/*.bib rm -rf .backup find -iname "*~" -or -iname "*.pdf" | xargs rm -rf find ./* -type f -iname "Makefile" $(findopts) > ls-R -# find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R + find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R rsync -avPr --files-from=ls-R . .backup rm -rf * cp -p -r .backup/* . @@ -57,30 +76,28 @@ inst: uninst auctex all cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) + cp -r samples/ $(UTREE)/doc/latex/$(NAME) local: uninst auctex $(CMP) $(NAME).ins mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) -#install: all -# sudo mkdir -p $(LOCAL)/{tex,source,doc}/lualatex/$(NAME) -# sudo cp $(NAME).dtx $(LOCAL)/source/lualatex/$(NAME) -# sudo cp $(NAME).sty $(LOCAL)/tex/lualatex/$(NAME) -# sudo cp $(NAME).pdf $(LOCAL)/doc/lualatex/$(NAME) zip: all ln -sf . $(NAME) - zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README.md,$(NAME).{pdf,sty,lua,el}} + zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{samples,README.md,$(NAME).{pdf,sty,lua,el}} rm $(NAME) package: distclean all mkdir $(NAME)/ - cp README.md *.ins *.dtx *.pdf $(NAME)/ + cp Makefile README.md $(NAME).{ins,dtx,pdf} $(NAME)/ + cp -r samples/ $(NAME)/ mkdir -p tex/lualatex/$(NAME)/ cp *.lua *.sty tex/lualatex/$(NAME)/ mkdir -p doc/lualatex/$(NAME)/ cp README.md *.el *.pdf doc/lualatex/$(NAME)/ + cp -r samples/ doc/lualatex/$(NAME)/ mkdir -p source/lualatex/$(NAME)/ cp Makefile *.ins *.dtx source/lualatex/$(NAME)/ zip -r $(NAME).tds.zip tex doc source -- cgit v1.2.3