diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -6,19 +6,11 @@ VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') | |||
6 | LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) | 6 | LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) |
7 | UTREE = $(shell kpsewhich --var-value TEXMFHOME) | 7 | UTREE = $(shell kpsewhich --var-value TEXMFHOME) |
8 | HOMEDIR := $$HOME | 8 | HOMEDIR := $$HOME |
9 | SAMPLES := samples | ||
9 | 10 | ||
10 | exts := md html ins dtx el | 11 | exts := md html ins dtx el |
11 | texsamples := $(basename $(wildcard $(PWD)/samples/*.tex)) | ||
12 | texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex))) | ||
13 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") | 12 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") |
14 | 13 | ||
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 | |||
22 | all: sty $(NAME).pdf | 14 | all: sty $(NAME).pdf |
23 | 15 | ||
24 | sty: clean | 16 | sty: 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 | ||
44 | samples: clean sty | 33 | samples: 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 | ||
49 | clean: | 36 | clean: |
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 |