aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 4 insertions, 17 deletions
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//')
6LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) 6LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
7UTREE = $(shell kpsewhich --var-value TEXMFHOME) 7UTREE = $(shell kpsewhich --var-value TEXMFHOME)
8HOMEDIR := $$HOME 8HOMEDIR := $$HOME
9SAMPLES := samples
9 10
10exts := md html ins dtx el 11exts := md html ins dtx el
11texsamples := $(basename $(wildcard $(PWD)/samples/*.tex))
12texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex)))
13findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") 12findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)")
14 13
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
22all: sty $(NAME).pdf 14all: sty $(NAME).pdf
23 15
24sty: clean 16sty: clean
@@ -26,10 +18,7 @@ sty: clean
26 18
27$(NAME).pdf: $(NAME).dtx 19$(NAME).pdf: $(NAME).dtx
28 @ echo "Make the sample files first..." 20 @ echo "Make the sample files first..."
29 if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi 21 $(MAKE) --directory=$(SAMPLES)
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)..." 22 @ echo "Build the documentation of $(NAME)..."
34 $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null 23 $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null
35 biber $(NAME) >/dev/null 24 biber $(NAME) >/dev/null
@@ -42,15 +31,13 @@ $(NAME).pdf: $(NAME).dtx
42 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 31 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
43 32
44samples: clean sty 33samples: clean sty
45 if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi 34 $(MAKE) --directory=$(SAMPLES)
46 $(foreach file,$(texsamples), $(call dosamples, $(file)))
47 mv TMP/*{\.pdf,-tei\.xml} samples/
48 35
49clean: 36clean:
50 rm -rf auto 37 rm -rf auto
51 rm -f $(NAME).bib $(PWD)/TMP/*.bib 38 rm -f $(NAME).bib $(PWD)/TMP/*.bib
52 rm -rf .backup 39 rm -rf .backup
53 find -iname "*~" -or -iname "*.pdf" | xargs rm -rf 40 find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf
54 find ./* -type f -iname "Makefile" $(findopts) > ls-R 41 find ./* -type f -iname "Makefile" $(findopts) > ls-R
55 find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R 42 find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R
56 rsync -aPr --files-from=ls-R . .backup 43 rsync -aPr --files-from=ls-R . .backup