source: trunk/adm/makefile @ 89

Last change on this file since 89 was 87, checked in by pinsard, 14 years ago

improve makefile dependencies

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 11.4 KB
RevLine 
[3]1#+
[4]2#
[76]3# ========
4# makefile
5# ========
[3]6#
[9]7# génération des manuels ircaam
[3]8#
9# TODO
10# ====
11#
[61]12# ++ doc executable vs doc sources (pour progfiltrage_simulation.F90)
[3]13#
[61]14# ++ 2 docs pour forfilter.f (filtre et kiser)
15#
[9]16# ++ lien avec les guides
[3]17#
18# EVOLUTIONS
19# ==========
20#
[4]21# $Id$
[3]22#
[87]23# - fplod 20100910T145305Z aedon.locean-ipsl.upmc.fr (Darwin)
24#
25#
26#   * try to improve dependencies
27#   * clean useless macros
28
[84]29# - fplod 20100712T140824Z aedon.locean-ipsl.upmc.fr (Darwin)
30#
31#   * add installation of src_browser output
32#
[83]33# - fplod 20100621T090148Z aedon.locean-ipsl.upmc.fr (Darwin)
34#
35#   * remove most of docutils
36#   * singlehtml with sphinx
37#
[79]38# - fplod 20100419T092312Z aedon.locean-ipsl.upmc.fr (Darwin)
39#
40#   * add browser for FORTRAN and MATLAB sources
41#
[74]42# - fplod 20100325T114658Z aedon.locean-ipsl.upmc.fr (Darwin)
43#
44#   * add sphinx for HTML and PDF productions
45#   * remove html_one and pdf_one
46#
[70]47# - fplod 20100310T111645Z aedon.locean-ipsl.upmc.fr (Darwin)
48#
49#   * add man_troff possible now with docutils 0.6
50#     can be test with
51#      $ man -M ../doc//manuals/man ircaam_profile.sh
52#
[63]53# - fplod 2009-05-13T12:48:45Z aedon.locean-ipsl.upmc.fr (Darwin)
54#
55#   * implicit rules
56#
57#     nb : may be will only work wih GNU make
58#     but easier to update : only one line to add in thi makefile when
59#     a new file (.pro or .sh) is added in $(DIRSRC) directory
60#
61#   * rst2latex usage of manuals_many.sty and manual_one.sty (for TOC and parindent)
62#   * bug fix for PDF manual (missing one pdf2latex)
63#
[61]64# - fplod 2009-04-03T08:01:24Z aedon.locean-ipsl.upmc.fr (Darwin)
65#
66#   * replace rst2newlatex by rst2latex and add options
67#   * suppression of rawlatex
68#   * add TOC thanks to http://docutils.sourceforge.net/docs/user/rst/demo.txt
69#
70# - fplod 2009-02-10T10:36:02Z aedon.locean-ipsl.upmc.fr (Darwin)
71#
72#   * add progfiltrage_simulation.F90, forfilter.f (new category sources fortran)
73#   * add progfiltrage_simulation.x (new category executable)++
74#
75# - fplod 2009-02-02T13:25:23Z aedon.locean-ipsl.upmc.fr (Darwin)
76#
77#   * add time_serie_eof_df.m, carte_eof_df.m, prepare_olr_filtre_simulation.m
78#
79# - fplod 2009-01-28T08:13:15Z aedon.locean-ipsl.upmc.fr (Darwin)
80#
81#   * add reconstitution_ER_rossby_df.m, time_serie_histog_phase.m,
82#     time_serie_histog_phase_num.m, composite_olr_phase.m,
83#     composite_olr_phase_num.m, composite_olr_eof_df.m,
84#     time_serie_jjas_df.m
85#
86# - fplod 2009-01-27T11:40:41Z aedon.locean-ipsl.upmc.fr (Darwin)
87#
88#   * add time_serie_ER_rossby_df.m, time_serie_ER_rossby_df_complet.m,
89#     carte_eof_ER_jjas_df.m, olr_eof_jjas2006_rossby_df.m,
90#     carte_eof234_jjas_df.m
91#
92# - fplod 2009-01-06T13:47:14Z aedon.locean-ipsl.upmc.fr (Darwin)
93#
94#   * add palette1.m palette3.m palettejerome30.m
95#
96# - fplod 2009-01-05T11:14:07Z aedon.locean-ipsl.upmc.fr (Darwin)
97#
98#   * add sauvegrads.m cartemonde.m cartemonde1.m palette.m palettecomplet.m
99#
[4]100# - fplod 2008-12-05T11:15:37Z aedon.locean-ipsl.upmc.fr (Darwin)
101#
[3]102#   * creation
103#
104# SEE ALSO
105# ========
106#
107# extract_rst.sh_
108#
109# .. _extract_rst.sh: ../extract_rst.sh.html
110#
[7]111#-
[3]112#
113PRODUCT = \
114ircaam
115
116PRODUCTNAME = \
[9]117$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
[3]118
119SUBPRODUCT = \
120ircaam_ws
121
122DIRSRC = \
[9]123../src/
[3]124
[63]125DIRADM = \
126./
127
[3]128DIRTMP = \
129./
130
[68]131DIRDESIGN = \
132./design/
133
[3]134DIRWWW = \
[9]135../doc/
[3]136
137URLPUBLISH = \
[64]138http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/doc/manuals/
[3]139
140LIST_SRCSH = \
[9]141$(DIRSRC)/$(PRODUCT)_profile.sh \
142$(DIRSRC)/dlogd.sh \
143$(DIRSRC)/elogd.sh \
144$(DIRSRC)/plogd.sh \
[61]145$(DIRSRC)/tlogd.sh \
146$(DIRSRC)/refdataget.sh
[3]147
[63]148LIST_SRCSH_RST = \
149$(shell echo "$(LIST_SRCSH)" | \
[87]150        sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
[74]151            -e "s+\.sh+.sh.rst+g")
[63]152
[70]153LIST_SRCSH_TROFF = \
154$(shell echo "$(LIST_SRCSH)" | \
[74]155        sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \
156            -e "s+\.sh+.sh.1+g")
[70]157
[12]158LIST_SRCMATLAB = \
[61]159$(DIRSRC)/$(PRODUCT)_startup.m \
160$(DIRSRC)/sauvegrads.m \
161$(DIRSRC)/cartemonde.m \
162$(DIRSRC)/cartemonde1.m \
163$(DIRSRC)/palette.m \
164$(DIRSRC)/palettecomplet.m \
165$(DIRSRC)/palette1.m \
166$(DIRSRC)/palette3.m \
167$(DIRSRC)/palettejerome30.m \
168$(DIRSRC)/mode_sahelien/time_serie_ER_rossby_df.m \
169$(DIRSRC)/mode_sahelien/time_serie_ER_rossby_df_complet.m \
170$(DIRSRC)/mode_sahelien/carte_eof_ER_jjas_df.m \
171$(DIRSRC)/mode_sahelien/olr_eof_jjas2006_rossby_df.m \
172$(DIRSRC)/mode_sahelien/carte_eof234_jjas_df.m \
173$(DIRSRC)/mode_sahelien/reconstitution_ER_rossby_df.m \
174$(DIRSRC)/mode_sahelien/time_serie_histog_phase.m \
175$(DIRSRC)/mode_sahelien/time_serie_histog_phase_num.m \
176$(DIRSRC)/mode_sahelien/composite_olr_phase.m \
177$(DIRSRC)/mode_sahelien/composite_olr_phase_num.m \
178$(DIRSRC)/mode_sahelien/composite_olr_eof_df.m \
179$(DIRSRC)/mode_sahelien/time_serie_jjas_df.m \
180$(DIRSRC)/SIMULS_IRCAAM/time_serie_eof_df.m \
181$(DIRSRC)/SIMULS_IRCAAM/carte_eof_df.m \
182$(DIRSRC)/SIMULS_IRCAAM/prepare_olr_filtre_simulation.m
[12]183
[63]184LIST_SRCMATLAB_RST = \
185$(shell echo "$(LIST_SRCMATLAB)" | \
[87]186        sed -e "s+$(DIRSRC)/mode_sahelien+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
187            -e "s+$(DIRSRC)/SIMULS_IRCAAM+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
188            -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
[74]189            -e "s+\.m+.m.rst+g")
[63]190
[61]191LIST_SRCFORTRAN = \
192$(DIRSRC)/SIMULS_IRCAAM/progfiltrage_simulation.F90 \
193$(DIRSRC)/forfilter.f
194
[63]195LIST_SRCFORTRAN_RST = \
196$(shell echo "$(LIST_SRCFORTRAN)" | \
[87]197        sed -e "s+$(DIRSRC)/SIMULS_IRCAAM+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
198            -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \
[74]199            -e "s+\.F90+.F90.rst+g" \
200            -e "s+\.f+.f.rst+g")
[63]201
[3]202.PHONY : \
203help \
204before \
205clean \
[68]206cleantmp \
207design \
[3]208htmllinkcheckb \
209htmllinkchecka \
210spellcheck \
211all \
[80]212man \
[70]213man_troff \
[83]214man_troff_sphinx \
[87]215html \
216html_sphinx \
217html_sphinx_one \
218pdf \
219pdf_sphinx \
[78]220html_src_browser \
221html_src_browser_doxygen
[3]222
223help :
224        @echo "Prepare output directories :"
225        @echo "\$$ make before"
226        @echo ""
227        @echo "Following commands are available to build outputs :"
228        @echo "\$$ make all"
229        @echo " "
230        @echo "Check links before installation : "
231        @echo "\$$ make htmllinkcheckb"
232        @echo " "
[64]233        @echo "Last step = installation of HTML and pdf files"
234        @echo "\$$ make install_all"
[3]235        @echo " "
236        @echo "Check links after installation : "
237        @echo "\$$ make htmllinkchecka"
238        @echo " "
239
240before :
[70]241        @mkdir -p $(DIRWWW)/manuals/man/man1/
[76]242        @mkdir -p $(DIRWWW)/manuals/html/sphinx/
[74]243        @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/
244        @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/
[87]245        @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/
[78]246        @mkdir -p $(DIRWWW)/src_browser/
[3]247
[64]248install_all : \
249install_html \
[84]250install_pdf \
251install_browser
[3]252
[64]253install_html :
254        @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/html/ -u $(URLPUBLISH)/html/
255
256install_pdf :
257        @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/pdf/ -u $(URLPUBLISH)/pdf/
258
[84]259install_browser :
260        @$(DIRADM)/install.sh -w $(DIRWWW)/src_browser/doxygen/html/ -u $(URLPUBLISH)/src_browser/doxygen/html/
261
[7]262clean : \
[61]263cleantmp
[70]264        -@rm -fr $(DIRWWW)/manuals/man/
[3]265        -@rm -fr $(DIRWWW)/manuals/html/
266        -@rm -fr $(DIRWWW)/manuals/pdf/
267        -@rm -fr $(DIRWWW)/src_browser/
[7]268
269cleantmp :
[3]270        -@rm -f $(DIRTMP)/all.xml
271        -@rm -f $(DIRTMP)/*.tex
[74]272        -@rm -fr $(DIRTMP)/sphinx_tmpdir/
273        -@rm -f $(DIRTMP)/sphinx_*.log
[3]274
[68]275design : \
276$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \
277$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg
278
[3]279htmllinkcheckb :
[64]280        @$(DIRADM)/linkchecker.sh -d $(DIRWWW)/manuals/html/
[3]281
282htmllinkchecka :
[64]283        @$(DIRADM)/linkchecker.sh -u $(URLPUBLISH)
[3]284
285spellcheck :
286        @++aspell --mode=sgml --master=english -c \
287        $(DIRSRC)/$(PRODUCT).xml
288
289all : \
[78]290man \
[80]291html_src_browser
[78]292
293man : \
[70]294man_troff \
[87]295html \
296pdf \
[3]297
[80]298html_src_browser : \
[78]299html_src_browser_doxygen
300
[70]301man_troff : \
[83]302man_troff_sphinx
[70]303
[83]304man_troff_sphinx : \
305$(DIRADM)/sphinx/conf.py \
306$(DIRTMP)/sphinx_tmpdir/index.rst \
307$(LIST_SRCSH_RST) \
308$(LIST_SRCMATLAB_RST) \
309$(LIST_SRCFORTRAN_RST)
310        @sphinx-build -b man -c $(DIRADM)/sphinx \
311            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
312            -w $(DIRTMP)/sphinx_html.log \
313            $(DIRTMP)/sphinx_tmpdir/ \
314            $(DIRWWW)/manuals/man/man1/
315
[87]316html : \
317html_sphinx \
318html_sphinx_one
[3]319
[87]320html_sphinx : \
[74]321$(DIRADM)/sphinx/conf.py \
322$(DIRTMP)/sphinx_tmpdir/index.rst \
323$(LIST_SRCSH_RST) \
324$(LIST_SRCMATLAB_RST) \
325$(LIST_SRCFORTRAN_RST)
326        @sphinx-build -b html -c $(DIRADM)/sphinx \
327            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
328            -w $(DIRTMP)/sphinx_html.log \
329            $(DIRTMP)/sphinx_tmpdir/ \
330            $(DIRWWW)/manuals/html/sphinx/
331
[87]332html_sphinx_one : \
[83]333$(DIRADM)/sphinx/conf.py \
334$(DIRTMP)/sphinx_tmpdir/index.rst \
335$(LIST_SRCSH_RST) \
336$(LIST_SRCMATLAB_RST) \
337$(LIST_SRCFORTRAN_RST)
338        @sphinx-build -b singlehtml -c $(DIRADM)/sphinx \
339            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
340            -w $(DIRTMP)/sphinx_html.log \
341            $(DIRTMP)/sphinx_tmpdir/ \
342            $(DIRWWW)/manuals/html/sphinx_one/
343
[87]344pdf : \
345pdf_sphinx
[3]346
[87]347pdf_sphinx : \
[74]348$(DIRADM)/sphinx/conf.py \
349$(DIRTMP)/sphinx_tmpdir/index.rst \
[76]350$(LIST_SRCSH_RST) \
351$(LIST_SRCMATLAB_RST) \
352$(LIST_SRCFORTRAN_RST)
[74]353        @sphinx-build -b latex -c $(DIRADM)/sphinx \
354            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
355            -w $(DIRTMP)/sphinx_pdf.log \
356            $(DIRTMP)/sphinx_tmpdir/ \
357            $(DIRTMP)/sphinx_tmpdir/latex_output
358        cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf
359        cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \
360           $(DIRWWW)/manuals/pdf/sphinx/
361
362$(DIRTMP)/sphinx_tmpdir/index.rst :
[80]363        @echo ".. _index:" > $@
[74]364        @echo " " >> $@
365        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
366        @echo "$(PRODUCTNAME) manuals" >> $@
367        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
368        @echo " " >> $@
369        @echo "Shell scripts" >> $@
370        @echo "Shell scripts" | tr [:print:] = >> $@
371        @echo ".. toctree::" >> $@
372        @echo "   :maxdepth: 1" 1>> $@
373        @echo "   :glob:" 1>> $@
374        @echo " " >> $@
375        @for file in $(LIST_SRCSH); \
376        do \
[87]377           echo "   manuals/$$(basename $${file})"; \
[74]378        done >> $@
379        @echo " " >> $@
380        @echo "MATLAB scripts" >> $@
381        @echo "MATLAB scripts" | tr [:print:] = >> $@
382        @echo ".. toctree::" >> $@
383        @echo "   :maxdepth: 1" 1>> $@
384        @echo "   :glob:" 1>> $@
385        @echo " " >> $@
386        @for file in $(LIST_SRCMATLAB); \
387        do \
[87]388           echo "   manuals/$$(basename $${file})"; \
[74]389        done >> $@
390        @echo " " >> $@
391        @echo "Fortran Sources" >> $@
392        @echo "Fortran Sources" | tr [:print:] = >> $@
393        @echo ".. toctree::" >> $@
394        @echo "   :maxdepth: 1" 1>> $@
395        @echo "   :glob:" 1>> $@
396        @echo " " >> $@
397        @for file in $(LIST_SRCFORTRAN); \
398        do \
[87]399           echo "   manuals/$$(basename $${file})"; \
[74]400        done >> $@
401        @echo " " >> $@
402        @echo "Indices and tables" >> $@
403        @echo "Indices and tables" | tr [:print:] = >> $@
404        @echo "* :ref:\`search\`" >> $@
405        @echo " " >> $@
406
[78]407html_src_browser_doxygen : \
408        $(DIRWWW)/src_browser/doxygen/
409
410$(DIRWWW)/src_browser/doxygen/ : \
[79]411$(DIRADM)/Doxyfile_$(PRODUCT) \
[78]412$(LIST_SRCMATLAB) \
413$(LIST_SRCFORTRAN) 
414        @doxygen $<
415        @touch $@
416
[87]417$(DIRTMP)/sphinx_tmpdir/manuals/%.sh.rst : $(DIRSRC)/%.sh $(DIRADM)/extract_rst.sh
[63]418        @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@
[3]419
[87]420$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/%.m $(DIRADM)/extract_rst.sh
[63]421        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
[3]422
[87]423$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/mode_sahelien/%.m $(DIRADM)/extract_rst.sh
[63]424        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
[3]425
[87]426$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/SIMULS_IRCAAM/%.m $(DIRADM)/extract_rst.sh
[63]427        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
[3]428
[87]429$(DIRTMP)/sphinx_tmpdir/manuals/%.F90.rst : $(DIRSRC)/SIMULS_IRCAAM/%.F90 $(DIRADM)/extract_rst.sh
[63]430        @$(DIRADM)/extract_rst.sh -i $< -l fortran -o $@
[3]431
[87]432$(DIRTMP)/sphinx_tmpdir/manuals/%.f.rst : $(DIRSRC)/%.f $(DIRADM)/extract_rst.sh
[63]433        @$(DIRADM)/extract_rst.sh -i $< -l fortran -o $@
[68]434
435$(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg
436        @convert $< $@
437
438$(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot
439        @dot -Tsvg -o $@ $<
440
441$(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \
442./makefile
443        @makeppgraph --graphviz --output=$@
Note: See TracBrowser for help on using the repository browser.