From b985ad19f4f15d7240a767cfeb2c985cff3d7c53 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sat, 1 Aug 2020 21:42:45 +0200 Subject: added Makefile in samples/ --- Makefile | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1026fae..8a9009c 100644 --- a/Makefile +++ b/Makefile @@ -6,19 +6,11 @@ VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) UTREE = $(shell kpsewhich --var-value TEXMFHOME) HOMEDIR := $$HOME +SAMPLES := samples 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 @@ -26,10 +18,7 @@ sty: clean $(NAME).pdf: $(NAME).dtx @ 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/ + $(MAKE) --directory=$(SAMPLES) @ echo "Build the documentation of $(NAME)..." $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null biber $(NAME) >/dev/null @@ -42,15 +31,13 @@ $(NAME).pdf: $(NAME).dtx $(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/ + $(MAKE) --directory=$(SAMPLES) clean: rm -rf auto rm -f $(NAME).bib $(PWD)/TMP/*.bib rm -rf .backup - find -iname "*~" -or -iname "*.pdf" | xargs rm -rf + find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf find ./* -type f -iname "Makefile" $(findopts) > ls-R find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R rsync -aPr --files-from=ls-R . .backup -- cgit v1.2.3