source: trunk/adm/makefile @ 12

Last change on this file since 12 was 12, checked in by pinsard, 15 years ago

add matlab startup

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 9.5 KB
Line 
1#+
2#
3# module
4# ======
5#
6# génération des manuels ircaam
7#
8# FILES
9# =====
10#
11# /usr/home/fplod/incas/ircaam/ircaam_ws/adm/makefile sur aedon.locean-ipsl.upmc.fr
12#
13# TODO
14# ====
15#
16# ++ amélioration de la page index
17#
18# ++ lien avec les guides
19#
20# EVOLUTIONS
21# ==========
22#
23# $Id$
24#
25# - fplod 2008-12-05T11:15:37Z aedon.locean-ipsl.upmc.fr (Darwin)
26#
27#   * creation
28#
29# SEE ALSO
30# ========
31#
32# extract_rst.sh_
33#
34# .. _extract_rst.sh: ../extract_rst.sh.html
35#
36#-
37#
38PRODUCT = \
39ircaam
40
41PRODUCTNAME = \
42$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
43
44SUBPRODUCT = \
45ircaam_ws
46
47DIRSRC = \
48../src/
49
50DIRTMP = \
51./
52
53DIRWWW = \
54../doc/
55
56URLPUBLISH = \
57http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/
58
59LIST_SRCSH = \
60$(DIRSRC)/$(PRODUCT)_profile.sh \
61$(DIRSRC)/dlogd.sh \
62$(DIRSRC)/elogd.sh \
63$(DIRSRC)/plogd.sh \
64$(DIRSRC)/tlogd.sh
65
66LIST_SRCMATLAB = \
67$(DIRSRC)/$(PRODUCT)_startup.m
68
69.PHONY : \
70help \
71before \
72clean \
73htmllinkcheckb \
74htmllinkchecka \
75spellcheck \
76all \
77html \
78pdf
79
80help :
81        @echo "Prepare output directories :"
82        @echo "\$$ make before"
83        @echo ""
84        @echo "Following commands are available to build outputs :"
85        @echo "\$$ make all"
86        @echo " "
87        @echo "Check links before installation : "
88        @echo "\$$ make htmllinkcheckb"
89        @echo " "
90        @echo "Last step = installation"
91        @echo "\$$ make install"
92        @echo " "
93        @echo "Check links after installation : "
94        @echo "\$$ make htmllinkchecka"
95        @echo " "
96
97before :
98        @mkdir -p $(DIRWWW)/manuals/html/one/
99        @mkdir -p $(DIRWWW)/manuals/html/many/
100        @mkdir -p $(DIRWWW)/manuals/pdf/one/
101        @mkdir -p $(DIRWWW)/manuals/pdf/many/
102
103install :
104        @install.sh -w $(DIRWWW) -u $(URLPUBLISH)
105
106clean : \
107cleantmp
108        -@rm -fr $(DIRWWW)/manuals/html/
109        -@rm -fr $(DIRWWW)/manuals/pdf/
110        -@rm -fr $(DIRWWW)/src_browser/
111
112cleantmp :
113        -@rm -f $(DIRTMP)/all.xml
114        -@rm -f $(DIRTMP)/*.rst
115        -@rm -f $(DIRTMP)/*.rst[12]
116        -@rm -f $(DIRTMP)/links.rst*
117        -@rm -f $(DIRTMP)/*.tex
118        -@rm -f $(DIRWWW)/manuals/pdf/one/*.aux
119        -@rm -f $(DIRWWW)/manuals/pdf/one/*.log
120        -@rm -f $(DIRWWW)/manuals/pdf/one/*.out
121        -@rm -f $(DIRWWW)/manuals/pdf/many/*.aux
122        -@rm -f $(DIRWWW)/manuals/pdf/many/*.log
123        -@rm -f $(DIRWWW)/manuals/pdf/many/*.out
124
125htmllinkcheckb :
126        @linkchecker.sh -d $(DIRWWW)/manuals/html/
127
128htmllinkchecka :
129        @linkchecker.sh -u $(URLPUBLISH)
130
131spellcheck :
132        @++aspell --mode=sgml --master=english -c \
133        $(DIRSRC)/$(PRODUCT).xml
134
135all : \
136man_html \
137man_pdf
138
139man_html : \
140man_html_one \
141man_html_many
142
143man_html_one : \
144$(DIRWWW)/manuals/html/one/index.html
145
146man_html_many : \
147$(DIRWWW)/manuals/html/many/index.html \
148$(DIRWWW)/manuals/html/many/$(PRODUCT)_profile.sh.html \
149$(DIRWWW)/manuals/html/many/dlogd.sh.html \
150$(DIRWWW)/manuals/html/many/elogd.sh.html \
151$(DIRWWW)/manuals/html/many/plogd.sh.html \
152$(DIRWWW)/manuals/html/many/tlogd.sh.html \
153$(DIRWWW)/manuals/html/many/$(PRODUCT)_startup.m.html \
154
155man_pdf : \
156man_pdf_one \
157man_pdf_many
158
159man_pdf_one : \
160$(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf \
161
162man_pdf_many : \
163$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_profile.sh.pdf \
164$(DIRWWW)/manuals/pdf/many/dlogd.sh.pdf \
165$(DIRWWW)/manuals/pdf/many/elogd.sh.pdf \
166$(DIRWWW)/manuals/pdf/many/plogd.sh.pdf \
167$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf \
168$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_startup.m.pdf \
169
170$(DIRWWW)/manuals/html/many/index.html : \
171$(DIRTMP)/index.rst
172        @rst2html.py --input-encoding=ISO-8859-15 --strict \
173        $< $@
174
175$(DIRWWW)/manuals/html/one/index.html : \
176$(DIRTMP)/$(PRODUCT)_manuals.rst
177        @rst2html.py --input-encoding=ISO-8859-15 --strict \
178        $< $@
179
180$(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf : \
181$(DIRTMP)/$(PRODUCT)_manuals.tex
182        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/one/ $<
183
184$(DIRTMP)/$(PRODUCT)_manuals.tex : \
185$(DIRTMP)/$(PRODUCT)_manuals.rst
186        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
187        $< $@
188
189$(DIRTMP)/$(PRODUCT)_manuals.rst : \
190$(DIRTMP)/index.rst \
191$(DIRTMP)/$(PRODUCT)_profile.sh.rst \
192$(DIRTMP)/dlogd.sh.rst \
193$(DIRTMP)/elogd.sh.rst \
194$(DIRTMP)/plogd.sh.rst \
195$(DIRTMP)/tlogd.sh.rst \
196$(DIRTMP)/$(PRODUCT)_startup.m.rst
197        @cat $(DIRTMP)/index.rst > ${DIRTMP}/$(PRODUCT)_manuals.rst1
198        @for file in $(LIST_SRCSH); \
199        do echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
200        echo ".. raw:: latex" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
201        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
202        echo "  \newpage" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
203        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
204        echo ".. _$$(basename $${file}) :" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
205        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
206        echo "$$(basename $${file})" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
207        echo "$$(basename $${file} | tr [:print:] =)" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ; \
208        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
209        sed -e "s/^==*$$/-----------------/" ${DIRTMP}/$$(basename $${file}).rst >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
210        done
211        @for file in $(LIST_SRCMATLAB); \
212        do echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
213        echo ".. raw:: latex" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
214        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
215        echo "  \newpage" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
216        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
217        echo ".. _$$(basename $${file}) :" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
218        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
219        echo "$$(basename $${file})" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
220        echo "$$(basename $${file} | tr [:print:] =)" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ; \
221        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
222        sed -e "s/^==*$$/-----------------/" ${DIRTMP}/$$(basename $${file}).rst >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
223        done
224        @grep "\.\. _.*: .*$$" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
225        ${DIRTMP}/links.rst
226        @sed -e "s/^ *//" ${DIRTMP}/links.rst | sort -u > ${DIRTMP}/links.rst2
227        @sed -e "/\.\. _.*: .*$$/d" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
228        ${DIRTMP}/$(PRODUCT)_manuals.rst2
229        @cp ${DIRTMP}/$(PRODUCT)_manuals.rst2 $@
230
231$(DIRTMP)/index.rst :
232        @echo "=================" >> $@
233        @echo "$(PRODUCTNAME) manuals" >> $@
234        @echo "=================" >> $@
235        @echo " " >> $@
236        @echo "Shell scripts" >> $@
237        @echo "=============" >> $@
238        @for file in $(LIST_SRCSH); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@
239        @echo " " >> $@
240        @echo "MATLAB scripts" >> $@
241        @echo "==============" >> $@
242        @for file in $(LIST_SRCMATLAB); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@
243        @echo " " >> $@
244
245$(DIRWWW)/manuals/html/many/$(PRODUCT)_profile.sh.html : \
246$(DIRTMP)/$(PRODUCT)_profile.sh.rst
247        @rst2html.py --input-encoding=ISO-8859-15 --strict \
248        $< $@
249
250$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_profile.sh.pdf : \
251$(DIRTMP)/$(PRODUCT)_profile.sh.tex
252        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
253
254$(DIRTMP)/$(PRODUCT)_profile.sh.tex : \
255$(DIRTMP)/$(PRODUCT)_profile.sh.rst
256        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
257        $< $@
258
259$(DIRTMP)/$(PRODUCT)_profile.sh.rst : \
260$(DIRSRC)/$(PRODUCT)_profile.sh
261        @extract_rst.sh -i $< -l sh -o $@
262
263$(DIRWWW)/manuals/html/many/dlogd.sh.html : \
264$(DIRTMP)/dlogd.sh.rst
265        @rst2html.py --input-encoding=ISO-8859-15 --strict \
266        $< $@
267
268$(DIRWWW)/manuals/pdf/many/dlogd.sh.pdf : \
269$(DIRTMP)/dlogd.sh.tex
270        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
271        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
272
273$(DIRTMP)/dlogd.sh.tex : \
274$(DIRTMP)/dlogd.sh.rst
275        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
276        $< $@
277
278$(DIRTMP)/dlogd.sh.rst : \
279$(DIRSRC)/dlogd.sh
280        @extract_rst.sh -i $< -l sh -o $@
281
282$(DIRWWW)/manuals/html/many/elogd.sh.html : \
283$(DIRTMP)/elogd.sh.rst
284        @rst2html.py --input-encoding=ISO-8859-15 --strict \
285        $< $@
286
287$(DIRWWW)/manuals/pdf/many/elogd.sh.pdf : \
288$(DIRTMP)/elogd.sh.tex
289        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
290        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
291
292$(DIRTMP)/elogd.sh.tex : \
293$(DIRTMP)/elogd.sh.rst
294        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
295        $< $@
296
297$(DIRTMP)/elogd.sh.rst : \
298$(DIRSRC)/elogd.sh
299        @extract_rst.sh -i $< -l sh -o $@
300
301$(DIRWWW)/manuals/html/many/plogd.sh.html : \
302$(DIRTMP)/plogd.sh.rst
303        @rst2html.py --input-encoding=ISO-8859-15 --strict \
304        $< $@
305
306$(DIRWWW)/manuals/pdf/many/plogd.sh.pdf : \
307$(DIRTMP)/plogd.sh.tex
308        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
309        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
310
311$(DIRTMP)/plogd.sh.tex : \
312$(DIRTMP)/plogd.sh.rst
313        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
314        $< $@
315
316$(DIRTMP)/plogd.sh.rst : \
317$(DIRSRC)/plogd.sh
318        @extract_rst.sh -i $< -l sh -o $@
319
320$(DIRWWW)/manuals/html/many/tlogd.sh.html : \
321$(DIRTMP)/tlogd.sh.rst
322        @rst2html.py --input-encoding=ISO-8859-15 --strict \
323        $< $@
324
325$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf : \
326$(DIRTMP)/tlogd.sh.tex
327        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
328        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
329
330$(DIRTMP)/tlogd.sh.tex : \
331$(DIRTMP)/tlogd.sh.rst
332        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
333        $< $@
334
335$(DIRTMP)/tlogd.sh.rst : \
336$(DIRSRC)/tlogd.sh
337        @extract_rst.sh -i $< -l sh -o $@
338
339$(DIRWWW)/manuals/html/many/$(PRODUCT)_startup.m.html : \
340$(DIRTMP)/$(PRODUCT)_startup.m.rst
341        @rst2html.py --input-encoding=ISO-8859-15 --strict \
342        $< $@
343
344$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_startup.m.pdf : \
345$(DIRTMP)/$(PRODUCT)_startup.m.tex
346        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
347
348$(DIRTMP)/$(PRODUCT)_startup.m.tex : \
349$(DIRTMP)/$(PRODUCT)_startup.m.rst
350        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
351        $< $@
352
353$(DIRTMP)/$(PRODUCT)_startup.m.rst : \
354$(DIRSRC)/$(PRODUCT)_startup.m
355        @extract_rst.sh -i $< -l matlab -o $@
Note: See TracBrowser for help on using the repository browser.