Debian Codegraph @

texmf-dist/source/latex/mdframed/Makefile

raw
1 ################################################################
2 ## Makefile for mdframed project folder
3 ## $Id: Makefile 428 2012-06-06 12:30:18Z marco $
4 ################################################################
5 ## Definitions
6 ################################################################
7 .SILENT:
8 SHELL := /bin/bash
9 .PHONY: all clean ctan allwithoutclean
10 ################################################################
11 ## Name list
12 ################################################################
13 PACKAGE = mdframed
14 EXAMPLED = mdframed-example-default
15 EXAMPLET = mdframed-example-tikz
16 EXAMPLEP = mdframed-example-pstricks
17 EXAMPLESX = mdframed-example-texsx
18 STYLE_I = md-frame-0
19 STYLE_II = md-frame-1
20 STYLE_III = md-frame-2
21 STYLE_IV = md-frame-3
22 EXAMPLLIST= $(EXAMPLED) $(EXAMPLET) $(EXAMPLEP) $(EXAMPLESX)
23 FILELIST = $(PACKAGE) $(EXAMPLED) $(EXAMPLET) $(EXAMPLEP) $(EXAMPLESX)
24 STYLELIST = $(STYLE_I) $(STYLE_II) $(STYLE_III) $(STYLE_IV)
25 AUXFILES = aux dtxe glo glolog gls hd ins idx idxlog ilg ind log out ps thm tmp toc xdv
26
27
28 ################################################################
29 ## Colordefinition
30 ################################################################
31 NO_COLOR = \x1b[0m
32 OK_COLOR = \x1b[32;01m
33 WARN_COLOR = \x1b[33;01m
34 ERROR_COLOR = \x1b[31;01m
35 ################################################################
36 ## make help
37 ################################################################
38 help:
39 @echo
40 @echo -e "$(WARN_COLOR)The following definitions provided by this Makefile"
41 @echo -e "$(OK_COLOR)\tmake docsty\t\t--\ttypesets the documenation and the package"
42 @echo -e "$(OK_COLOR)\tmake all\t\t--\trun docsty examples clean"
43 @echo -e "\tmake examples\t\t--\tcompiles all example files"
44 @echo -e "\tmake clean\t\t--\tremove all helpfiles created by mdframed"
45 @echo -e "\tmake changeversion\t--\tmaintaner tool to change the version"
46 @echo -e "\tmake changerevision\t--\tmaintaner tool to change the revision"
47 @echo -e "\tmake changedate\t--\tmaintaner tool to change the date"
48 @echo -e "\tmake localinstall\t--\tinstall the package in TEXMFHOME"
49 @echo -e "$(WARN_COLOR)End help$(NO_COLOR)"
50
51 ################################################################
52 ## Compilation
53 ################################################################
54 $(EXAMPLED).pdf: $(EXAMPLED).tex
55 $(EXAMPLET).pdf: $(EXAMPLET).tex
56 $(EXAMPLEP).ps: $(EXAMPLEP).tex
57 $(EXAMPLESX).pdf: $(EXAMPLESX).tex
58
59 %.pdf:
60 NAME=`basename $< .tex` ;\
61 echo -e "" ;\
62 echo -e "\t$(WARN_COLOR)Typesetting $$NAME$(NO_COLOR)" ;\
63 pdflatex --draftmode --interaction=nonstopmode $< > /dev/null ;\
64 if [ $$? = 0 ] ; then \
65 echo -e "\t$(OK_COLOR)compilation in draftmode without errors$(NO_COLOR)" ;\
66 echo -e "\t$(OK_COLOR)Run PDFLaTeX again on $$NAME.tex$(NO_COLOR)" ;\
67 pdflatex --interaction=nonstopmode $< > /dev/null ;\
68 else \
69 echo -e "\t$(ERROR_COLOR)compilation in draftmode with errors$(NO_COLOR)" ;\
70 exit 0;\
71 fi ;\
72 echo -e "\t$(OK_COLOR)Typesetting $$NAME finished $(NO_COLOR)" ;\
73
74 %.ps:
75 NAME=`basename $< .tex` ;\
76 echo -e "" ;\
77 echo -e "\t$(WARN_COLOR)Typesetting $$NAME$(NO_COLOR)" ;\
78 xelatex --no-pdf --interaction=nonstopmode $< > /dev/null ;\
79 if [ $$? = 0 ] ; then \
80 echo -e "\t$(OK_COLOR)compilation in draftmode without errors$(NO_COLOR)" ;\
81 echo -e "\t$(OK_COLOR)Run XeLaTeX again on $$NAME.tex$(NO_COLOR)" ;\
82 xelatex --interaction=nonstopmode $< > /dev/null ;\
83 else \
84 echo -e "\t$(ERROR_COLOR)compilation in draftmode with errors$(NO_COLOR)" ;\
85 exit 0;\
86 fi ;\
87 echo -e "\t$(OK_COLOR)Typesetting $$NAME done$(NO_COLOR)" ;\
88
89 # latex -draftmode -interaction=nonstopmode $< > /dev/null ;\
90 # if [ $$? = 0 ] ; then \
91 # echo -e "\t$(OK_COLOR)compilation in draftmode without errors$(NO_COLOR)" ;\
92 # echo -e "\t$(OK_COLOR)Run LaTeX again on $$NAME.tex$(NO_COLOR)" ;\
93 # latex -interaction=nonstopmode $< > /dev/null ;\
94 # latex -interaction=nonstopmode $< > /dev/null ;\
95 # dvips -q $$NAME.dvi ;\
96 # ps2pdf $$NAME.ps ;\
97 # else \
98 # echo -e "\t$(ERROR_COLOR)compilation in draftmode with errors$(NO_COLOR)" ;\
99 # exit 0;\
100 # fi ;\
101 # echo -e "\t$(OK_COLOR)Typesetting $$NAME done$(NO_COLOR)" ;\
102 ################################################################
103 ## Compilation
104 ################################################################
105 docsty: $(PACKAGE).dtx
106 echo -e "" ;\
107 echo -e "\t$(WARN_COLOR)Typesetting $(PACKAGE).dtx$(NO_COLOR)" ;\
108 pdflatex --draftmode --interaction=nonstopmode $(PACKAGE).dtx > /dev/null ;\
109 if [ $$? = 0 ] ; then \
110 echo -e "\t$(OK_COLOR)compilation in draftmode without errors$(NO_COLOR)" ;\
111 if [ -f $(PACKAGE).glo ] ; then \
112 echo -e "\t$(WARN_COLOR)Typesetting $(PACKAGE).glo$(NO_COLOR)" ;\
113 makeindex -q -t $(PACKAGE).glolog -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo ;\
114 if [ $$? = 0 ] ; then \
115 echo -e "\t$(OK_COLOR)compilation of Glossar without errors$(NO_COLOR)" ;\
116 else \
117 echo -e "\t$(ERROR_COLOR)compilation of Glossar with errors$(NO_COLOR)" ;\
118 fi ;\
119 fi ;\
120 if [ -f $(PACKAGE).idx ] ; then \
121 echo -e "\t$(WARN_COLOR)Typesetting $(PACKAGE).idx$(NO_COLOR)" ;\
122 makeindex -q -t $(PACKAGE).idxlog -s gind.ist $(PACKAGE).idx ;\
123 if [ $$? = 0 ] ; then \
124 echo -e "\t$(OK_COLOR)compilation of Index without errors$(NO_COLOR)" ;\
125 else \
126 echo -e "\t$(ERROR_COLOR)compilation of Index with errors$(NO_COLOR)" ;\
127 fi ;\
128 fi ;\
129 pdflatex $(PACKAGE).dtx > /dev/null ;\
130 if [ $$? = 0 ] ; then \
131 echo -e "\t$(OK_COLOR)Second pdflatex compilation without errors$(NO_COLOR)" ;\
132 else \
133 echo -e "\t$(ERROR_COLOR)Second pdflatex compilation with errors$(NO_COLOR)" ;\
134 exit 0;\
135 fi ;\
136 pdflatex $(PACKAGE).dtx > /dev/null ;\
137 else \
138 echo -e "\t$(ERROR_COLOR)compilation in draftmode with errors$(NO_COLOR)" ;\
139 exit 0;\
140 fi ;\
141
142 exampled: $(EXAMPLED).pdf
143 examplet: $(EXAMPLET).pdf
144 examplep: $(EXAMPLEP).ps
145 examplesx:$(EXAMPLESX).pdf
146
147 examples: exampled examplet examplep examplesx
148
149 clean:
150 echo "" ;\
151 echo -e "\t$(WARN_COLOR)Start removing help files$(NO_COLOR)" ;\
152 for I in $(FILELIST) ;\
153 do \
154 for J in $(AUXFILES) ;\
155 do \
156 rm -rf $$I.$$J ;\
157 done ;\
158 done ;\
159 echo -e "\t$(OK_COLOR)Removing finished$(NO_COLOR)" ;\
160
161 all: docsty examples clean
162
163 ################################################################
164 ## personal setting
165 ################################################################
166 localinstall: docsty examples makelocalinstall clean
167
168 makelocalinstall:
169 echo "" ;\
170 echo -e "\t$(ERROR_COLOR)Start local install$(NO_COLOR)" ;\
171 PATHTEXHOME=`kpsewhich --var-value=TEXMFHOME` ;\
172 echo -e "\t$(ERROR_COLOR)Creating folders if don't exist$(NO_COLOR)" ;\
173 mkdir -p $$PATHTEXHOME/doc/latex/$(PACKAGE)/ ;\
174 mkdir -p $$PATHTEXHOME/tex/latex/$(PACKAGE)/ ;\
175 for I in $(FILELIST) ;\
176 do \
177 cp $$I.pdf $$PATHTEXHOME/doc/latex/$(PACKAGE)/ ;\
178 done ;\
179 for I in $(STYLELIST) ;\
180 do \
181 cp $$I.mdf $$PATHTEXHOME/tex/latex/$(PACKAGE)/ ;\
182 done ;\
183 cp $(PACKAGE).sty $$PATHTEXHOME/tex/latex/$(PACKAGE)/ ;\
184 cp ltxmdf.cls $$PATHTEXHOME/tex/latex/$(PACKAGE)/ ;\
185 echo -e "\t$(OK_COLOR)Installation done$(NO_COLOR)" ;\
186
187 ################################################################
188 ## maintainer tool
189 ################################################################
190 changeversion:
191 @echo
192 @echo -e "$(OK_COLOR)Aktuell wird die folgende Version verwendet"
193 @sed '/\\def\\mdversion/!d' $(PACKAGE).sty
194 @echo -e "$(WARN_COLOR)"
195 @read -p "Bitte neue Version eingeben: " REPLY && sed -Eie "s/(\\\\def\\\\mdversion\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\
196 echo -e "$(OK_COLOR)Version geändert zu $$REPLY$(NO_COLOR)"
197 @echo
198
199 changerevision:
200 @echo
201 @echo -e "$(OK_COLOR)Aktuell wird die folgende Revision verwendet"
202 @sed '/\\def\\mdfrevision/!d' $(PACKAGE).dtx
203 @echo -e "$(WARN_COLOR)"
204 @REPLY=`git rev-list HEAD | wc -l` && sed -Eie "s/(\\\\def\\\\mdfrevision\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\
205 echo -e "$(OK_COLOR)Revision geändert zu $$REPLY$(NO_COLOR)"
206 @echo
207
208 changedate:
209 @echo
210 @echo -e "$(OK_COLOR)Aktuell wird die folgendes Datum verwendet"
211 @sed '/\\def\\mdfmaindate/!d' $(PACKAGE).dtx
212 @echo -e "$(WARN_COLOR)"
213 @REPLY=`date +"%Y\/%m\/%d"` && sed -Eie "s/(\\\\def\\\\mdfmaindate\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\
214 echo -e "$(OK_COLOR)Datum geändert zu $$REPLY$(NO_COLOR)"
215 @echo
216
217 change: changeversion changerevision changedate
218
219 usectanify:
220 echo "" ;\
221 echo -e "\t$(ERROR_COLOR)Start ctanify$(NO_COLOR)" ;\
222 ctanify $(PACKAGE).ins $(PACKAGE).pdf README.txt ltxmdf.cls \
223 ctan-lion.png=doc/latex/mdframed/ \
224 $(EXAMPLED).tex=doc/latex/mdframed/ \
225 $(EXAMPLED).pdf=doc/latex/mdframed/ \
226 $(EXAMPLET).tex=doc/latex/mdframed/ \
227 $(EXAMPLET).pdf=doc/latex/mdframed/ \
228 $(EXAMPLEP).tex=doc/latex/mdframed/ \
229 $(EXAMPLEP).pdf=doc/latex/mdframed/ \
230 $(EXAMPLESX).tex=doc/latex/mdframed/ \
231 $(EXAMPLESX).pdf=doc/latex/mdframed/ \
232 Makefile=source/latex/mdframed/ \
233 mdframedmake.bat=source/latex/mdframed/ \
234 md-frame-0.mdf=tex/latex/mdframed/ \
235 md-frame-1.mdf=tex/latex/mdframed/ \
236 md-frame-2.mdf=tex/latex/mdframed/ \
237 md-frame-3.mdf=tex/latex/mdframed/ ;\
238 if [ $$? = 0 ] ; then \
239 echo -e "\t$(OK_COLOR)ctanify without errors$(NO_COLOR)" ;\
240 echo -e "" ;\
241 else \
242 echo -e "\t$(ERROR_COLOR)ctanify with errors$(NO_COLOR)" ;\
243 exit 0;\
244 fi ;\
245
246 ctan: docsty examples usectanify clean