source: trunk/adm/makefile @ 48

Last change on this file since 48 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
RevLine 
[3]1#+
[4]2#
[3]3# module
4# ======
5#
[9]6# génération des manuels ircaam
[3]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#
[9]18# ++ lien avec les guides
[3]19#
20# EVOLUTIONS
21# ==========
22#
[4]23# $Id$
[3]24#
[4]25# - fplod 2008-12-05T11:15:37Z aedon.locean-ipsl.upmc.fr (Darwin)
26#
[3]27#   * creation
28#
29# SEE ALSO
30# ========
31#
32# extract_rst.sh_
33#
34# .. _extract_rst.sh: ../extract_rst.sh.html
35#
[7]36#-
[3]37#
38PRODUCT = \
39ircaam
40
41PRODUCTNAME = \
[9]42$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
[3]43
44SUBPRODUCT = \
45ircaam_ws
46
47DIRSRC = \
[9]48../src/
[3]49
50DIRTMP = \
51./
52
53DIRWWW = \
[9]54../doc/
[3]55
56URLPUBLISH = \
57http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/
58
59LIST_SRCSH = \
[9]60$(DIRSRC)/$(PRODUCT)_profile.sh \
61$(DIRSRC)/dlogd.sh \
62$(DIRSRC)/elogd.sh \
63$(DIRSRC)/plogd.sh \
64$(DIRSRC)/tlogd.sh
[3]65
[12]66LIST_SRCMATLAB = \
67$(DIRSRC)/$(PRODUCT)_startup.m
68
[3]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 :
[7]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/
[3]102
103install :
104        @install.sh -w $(DIRWWW) -u $(URLPUBLISH)
105
[7]106clean : \
107cleantmp
[3]108        -@rm -fr $(DIRWWW)/manuals/html/
109        -@rm -fr $(DIRWWW)/manuals/pdf/
110        -@rm -fr $(DIRWWW)/src_browser/
[7]111
112cleantmp :
[3]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
[7]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
[3]124
125htmllinkcheckb :
[7]126        @linkchecker.sh -d $(DIRWWW)/manuals/html/
[3]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 : \
[7]140man_html_one \
141man_html_many
[3]142
[7]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 \
[12]152$(DIRWWW)/manuals/html/many/tlogd.sh.html \
153$(DIRWWW)/manuals/html/many/$(PRODUCT)_startup.m.html \
[7]154
[3]155man_pdf : \
[7]156man_pdf_one \
157man_pdf_many
[3]158
[7]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 \
[12]167$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf \
168$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_startup.m.pdf \
[7]169
170$(DIRWWW)/manuals/html/many/index.html : \
[3]171$(DIRTMP)/index.rst
[9]172        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]173        $< $@
174
[7]175$(DIRWWW)/manuals/html/one/index.html : \
[3]176$(DIRTMP)/$(PRODUCT)_manuals.rst
[9]177        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]178        $< $@
179
[7]180$(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf : \
[3]181$(DIRTMP)/$(PRODUCT)_manuals.tex
[7]182        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/one/ $<
[4]183
[3]184$(DIRTMP)/$(PRODUCT)_manuals.tex : \
185$(DIRTMP)/$(PRODUCT)_manuals.rst
[9]186        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]187        $< $@
188
189$(DIRTMP)/$(PRODUCT)_manuals.rst : \
190$(DIRTMP)/index.rst \
[4]191$(DIRTMP)/$(PRODUCT)_profile.sh.rst \
192$(DIRTMP)/dlogd.sh.rst \
193$(DIRTMP)/elogd.sh.rst \
194$(DIRTMP)/plogd.sh.rst \
[12]195$(DIRTMP)/tlogd.sh.rst \
196$(DIRTMP)/$(PRODUCT)_startup.m.rst
[7]197        @cat $(DIRTMP)/index.rst > ${DIRTMP}/$(PRODUCT)_manuals.rst1
[3]198        @for file in $(LIST_SRCSH); \
199        do echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
[7]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 ;\
[3]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
[12]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
[7]224        @grep "\.\. _.*: .*$$" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
[3]225        ${DIRTMP}/links.rst
[7]226        @sed -e "s/^ *//" ${DIRTMP}/links.rst | sort -u > ${DIRTMP}/links.rst2
227        @sed -e "/\.\. _.*: .*$$/d" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
[3]228        ${DIRTMP}/$(PRODUCT)_manuals.rst2
[7]229        @cp ${DIRTMP}/$(PRODUCT)_manuals.rst2 $@
[3]230
231$(DIRTMP)/index.rst :
232        @echo "=================" >> $@
233        @echo "$(PRODUCTNAME) manuals" >> $@
234        @echo "=================" >> $@
235        @echo " " >> $@
236        @echo "Shell scripts" >> $@
237        @echo "=============" >> $@
[7]238        @for file in $(LIST_SRCSH); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@
[3]239        @echo " " >> $@
[12]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 " " >> $@
[3]244
[7]245$(DIRWWW)/manuals/html/many/$(PRODUCT)_profile.sh.html : \
[3]246$(DIRTMP)/$(PRODUCT)_profile.sh.rst
[9]247        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]248        $< $@
249
[7]250$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_profile.sh.pdf : \
[3]251$(DIRTMP)/$(PRODUCT)_profile.sh.tex
[7]252        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
[3]253
254$(DIRTMP)/$(PRODUCT)_profile.sh.tex : \
255$(DIRTMP)/$(PRODUCT)_profile.sh.rst
[9]256        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]257        $< $@
258
259$(DIRTMP)/$(PRODUCT)_profile.sh.rst : \
[9]260$(DIRSRC)/$(PRODUCT)_profile.sh
[3]261        @extract_rst.sh -i $< -l sh -o $@
262
[7]263$(DIRWWW)/manuals/html/many/dlogd.sh.html : \
[3]264$(DIRTMP)/dlogd.sh.rst
[9]265        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]266        $< $@
267
[7]268$(DIRWWW)/manuals/pdf/many/dlogd.sh.pdf : \
[3]269$(DIRTMP)/dlogd.sh.tex
[7]270        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
271        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
[3]272
273$(DIRTMP)/dlogd.sh.tex : \
274$(DIRTMP)/dlogd.sh.rst
[9]275        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]276        $< $@
277
278$(DIRTMP)/dlogd.sh.rst : \
[9]279$(DIRSRC)/dlogd.sh
[3]280        @extract_rst.sh -i $< -l sh -o $@
281
[7]282$(DIRWWW)/manuals/html/many/elogd.sh.html : \
[3]283$(DIRTMP)/elogd.sh.rst
[9]284        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]285        $< $@
286
[7]287$(DIRWWW)/manuals/pdf/many/elogd.sh.pdf : \
[3]288$(DIRTMP)/elogd.sh.tex
[7]289        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
290        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
[3]291
292$(DIRTMP)/elogd.sh.tex : \
293$(DIRTMP)/elogd.sh.rst
[9]294        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]295        $< $@
296
297$(DIRTMP)/elogd.sh.rst : \
[9]298$(DIRSRC)/elogd.sh
[3]299        @extract_rst.sh -i $< -l sh -o $@
300
[7]301$(DIRWWW)/manuals/html/many/plogd.sh.html : \
[3]302$(DIRTMP)/plogd.sh.rst
[9]303        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]304        $< $@
305
[7]306$(DIRWWW)/manuals/pdf/many/plogd.sh.pdf : \
[3]307$(DIRTMP)/plogd.sh.tex
[7]308        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
309        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
[3]310
311$(DIRTMP)/plogd.sh.tex : \
312$(DIRTMP)/plogd.sh.rst
[9]313        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]314        $< $@
315
316$(DIRTMP)/plogd.sh.rst : \
[9]317$(DIRSRC)/plogd.sh
[3]318        @extract_rst.sh -i $< -l sh -o $@
319
[7]320$(DIRWWW)/manuals/html/many/tlogd.sh.html : \
[3]321$(DIRTMP)/tlogd.sh.rst
[9]322        @rst2html.py --input-encoding=ISO-8859-15 --strict \
[3]323        $< $@
324
[7]325$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf : \
[3]326$(DIRTMP)/tlogd.sh.tex
[7]327        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
328        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
[3]329
330$(DIRTMP)/tlogd.sh.tex : \
331$(DIRTMP)/tlogd.sh.rst
[9]332        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
[3]333        $< $@
334
335$(DIRTMP)/tlogd.sh.rst : \
[9]336$(DIRSRC)/tlogd.sh
[3]337        @extract_rst.sh -i $< -l sh -o $@
[12]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.