aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 21 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 694b884..649af77 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,10 @@ SAMPLES := samples
11exts := md html ins dtx el 11exts := md html ins dtx el
12findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") 12findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)")
13 13
14define do_documentation
15 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx >/dev/null
16endef
17
14all: sty $(NAME).pdf 18all: sty $(NAME).pdf
15 19
16testsamples: 20testsamples:
@@ -23,24 +27,26 @@ sty: clean
23 27
24$(NAME).pdf: testsamples $(NAME).dtx 28$(NAME).pdf: testsamples $(NAME).dtx
25 @ echo "Making the sample files first..." 29 @ echo "Making the sample files first..."
26 $(MAKE) --directory=$(SAMPLES) 30 @ $(MAKE) --directory=$(SAMPLES) >/dev/null
27 @ echo "Building the documentation of $(NAME)..." 31 @ echo "Done making samples"
28 $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null 32 @ echo "Building the documentation of $(NAME). Please be patient..."
29 biber $(NAME) >/dev/null 33 @ $(do_documentation)
30 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 34 @ echo "Now calling biber"
31 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 35 @ biber $(NAME) >/dev/null
32 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 36 @ echo "Returning to lualatex..."
33 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 37 @ for run in {1..4}; do $(do_documentation); done
34 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi 38 @ echo "Building indexes..."
35 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi 39 @ if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
36 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 40 @ if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
37 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 41 @ echo "Final runs of lualatex..."
38 $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 42 @ for run in {1..3}; do $(call do_documentation); done
43 @ echo "Done"
39 44
40samples: clean sty 45samples: clean sty
41 $(MAKE) --directory=$(SAMPLES) 46 $(MAKE) --directory=$(SAMPLES)
42 47
43clean: testsamples 48clean: testsamples
49 @ echo "Cleaning $(NAME) directory"
44 rm -rf auto 50 rm -rf auto
45 rm -f $(NAME).bib $(PWD)/TMP/*.bib 51 rm -f $(NAME).bib $(PWD)/TMP/*.bib
46 rm -rf .backup 52 rm -rf .backup
@@ -66,12 +72,14 @@ uninst:
66 rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/$(NAME).{el,elc} 72 rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/$(NAME).{el,elc}
67 73
68inst: uninst auctex all 74inst: uninst auctex all
75 @ echo "Installing $(NAME) locally"
69 mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME) 76 mkdir -p $(UTREE)/{tex,source,doc}/lualatex/$(NAME)
70 cp $(NAME).dtx $(UTREE)/source/lualatex/$(NAME) 77 cp $(NAME).dtx $(UTREE)/source/lualatex/$(NAME)
71 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME) 78 cp $(NAME).sty $(UTREE)/tex/lualatex/$(NAME)
72 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME) 79 cp $(NAME).lua $(UTREE)/tex/lualatex/$(NAME)
73 cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME) 80 cp $(NAME).pdf $(UTREE)/doc/lualatex/$(NAME)
74 cp -r samples/ $(UTREE)/doc/lualatex/$(NAME) 81 cp -r samples/ $(UTREE)/doc/lualatex/$(NAME)
82 @ echo "Installation complete. Happy TeXing!"
75 83
76local: uninst auctex 84local: uninst auctex
77 $(CMP) $(NAME).ins 85 $(CMP) $(NAME).ins