#+ # # ======== # makefile # ======== # # génération des manuels ircaam # # TODO # ==== # # ++ doc executable vs doc sources (pour progfiltrage_simulation.F90) # # ++ 2 docs pour forfilter.f (filtre et kiser) # # ++ lien avec les guides # # EVOLUTIONS # ========== # # $Id$ # # - fplod 20100910T145305Z aedon.locean-ipsl.upmc.fr (Darwin) # # # * try to improve dependencies # * clean useless macros # - fplod 20100712T140824Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add installation of src_browser output # # - fplod 20100621T090148Z aedon.locean-ipsl.upmc.fr (Darwin) # # * remove most of docutils # * singlehtml with sphinx # # - fplod 20100419T092312Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add browser for FORTRAN and MATLAB sources # # - fplod 20100325T114658Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add sphinx for HTML and PDF productions # * remove html_one and pdf_one # # - fplod 20100310T111645Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add man_troff possible now with docutils 0.6 # can be test with # $ man -M ../doc//manuals/man ircaam_profile.sh # # - fplod 2009-05-13T12:48:45Z aedon.locean-ipsl.upmc.fr (Darwin) # # * implicit rules # # nb : may be will only work wih GNU make # but easier to update : only one line to add in thi makefile when # a new file (.pro or .sh) is added in $(DIRSRC) directory # # * rst2latex usage of manuals_many.sty and manual_one.sty (for TOC and parindent) # * bug fix for PDF manual (missing one pdf2latex) # # - fplod 2009-04-03T08:01:24Z aedon.locean-ipsl.upmc.fr (Darwin) # # * replace rst2newlatex by rst2latex and add options # * suppression of rawlatex # * add TOC thanks to http://docutils.sourceforge.net/docs/user/rst/demo.txt # # - fplod 2009-02-10T10:36:02Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add progfiltrage_simulation.F90, forfilter.f (new category sources fortran) # * add progfiltrage_simulation.x (new category executable)++ # # - fplod 2009-02-02T13:25:23Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add time_serie_eof_df.m, carte_eof_df.m, prepare_olr_filtre_simulation.m # # - fplod 2009-01-28T08:13:15Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add reconstitution_ER_rossby_df.m, time_serie_histog_phase.m, # time_serie_histog_phase_num.m, composite_olr_phase.m, # composite_olr_phase_num.m, composite_olr_eof_df.m, # time_serie_jjas_df.m # # - fplod 2009-01-27T11:40:41Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add time_serie_ER_rossby_df.m, time_serie_ER_rossby_df_complet.m, # carte_eof_ER_jjas_df.m, olr_eof_jjas2006_rossby_df.m, # carte_eof234_jjas_df.m # # - fplod 2009-01-06T13:47:14Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add palette1.m palette3.m palettejerome30.m # # - fplod 2009-01-05T11:14:07Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add sauvegrads.m cartemonde.m cartemonde1.m palette.m palettecomplet.m # # - fplod 2008-12-05T11:15:37Z aedon.locean-ipsl.upmc.fr (Darwin) # # * creation # # SEE ALSO # ======== # # extract_rst.sh_ # # .. _extract_rst.sh: ../extract_rst.sh.html # #- # PRODUCT = \ ircaam PRODUCTNAME = \ $$(echo $(PRODUCT) | tr [:lower:] [:upper:]) SUBPRODUCT = \ ircaam_ws DIRSRC = \ ../src/ DIRADM = \ ./ DIRTMP = \ ./ DIRDESIGN = \ ./design/ DIRWWW = \ ../doc/ URLPUBLISH = \ http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/doc/manuals/ LIST_SRCSH = \ $(DIRSRC)/$(PRODUCT)_profile.sh \ $(DIRSRC)/dlogd.sh \ $(DIRSRC)/elogd.sh \ $(DIRSRC)/plogd.sh \ $(DIRSRC)/tlogd.sh \ $(DIRSRC)/refdataget.sh LIST_SRCSH_RST = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+\.sh+.sh.rst+g") LIST_SRCSH_TROFF = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ -e "s+\.sh+.sh.1+g") LIST_SRCMATLAB = \ $(DIRSRC)/$(PRODUCT)_startup.m \ $(DIRSRC)/sauvegrads.m \ $(DIRSRC)/cartemonde.m \ $(DIRSRC)/cartemonde1.m \ $(DIRSRC)/palette.m \ $(DIRSRC)/palettecomplet.m \ $(DIRSRC)/palette1.m \ $(DIRSRC)/palette3.m \ $(DIRSRC)/palettejerome30.m \ $(DIRSRC)/mode_sahelien/time_serie_ER_rossby_df.m \ $(DIRSRC)/mode_sahelien/time_serie_ER_rossby_df_complet.m \ $(DIRSRC)/mode_sahelien/carte_eof_ER_jjas_df.m \ $(DIRSRC)/mode_sahelien/olr_eof_jjas2006_rossby_df.m \ $(DIRSRC)/mode_sahelien/carte_eof234_jjas_df.m \ $(DIRSRC)/mode_sahelien/reconstitution_ER_rossby_df.m \ $(DIRSRC)/mode_sahelien/time_serie_histog_phase.m \ $(DIRSRC)/mode_sahelien/time_serie_histog_phase_num.m \ $(DIRSRC)/mode_sahelien/composite_olr_phase.m \ $(DIRSRC)/mode_sahelien/composite_olr_phase_num.m \ $(DIRSRC)/mode_sahelien/composite_olr_eof_df.m \ $(DIRSRC)/mode_sahelien/time_serie_jjas_df.m \ $(DIRSRC)/SIMULS_IRCAAM/time_serie_eof_df.m \ $(DIRSRC)/SIMULS_IRCAAM/carte_eof_df.m \ $(DIRSRC)/SIMULS_IRCAAM/prepare_olr_filtre_simulation.m LIST_SRCMATLAB_RST = \ $(shell echo "$(LIST_SRCMATLAB)" | \ sed -e "s+$(DIRSRC)/mode_sahelien+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+$(DIRSRC)/SIMULS_IRCAAM+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+\.m+.m.rst+g") LIST_SRCFORTRAN = \ $(DIRSRC)/SIMULS_IRCAAM/progfiltrage_simulation.F90 \ $(DIRSRC)/forfilter.f LIST_SRCFORTRAN_RST = \ $(shell echo "$(LIST_SRCFORTRAN)" | \ sed -e "s+$(DIRSRC)/SIMULS_IRCAAM+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals+g" \ -e "s+\.F90+.F90.rst+g" \ -e "s+\.f+.f.rst+g") .PHONY : \ help \ before \ clean \ cleantmp \ design \ htmllinkcheckb \ htmllinkchecka \ spellcheck \ all \ man \ man_troff \ man_troff_sphinx \ html \ html_sphinx \ html_sphinx_one \ pdf \ pdf_sphinx \ html_src_browser \ html_src_browser_doxygen help : @echo "Prepare output directories :" @echo "\$$ make before" @echo "" @echo "Following commands are available to build outputs :" @echo "\$$ make all" @echo " " @echo "Check links before installation : " @echo "\$$ make htmllinkcheckb" @echo " " @echo "Last step = installation of HTML and pdf files" @echo "\$$ make install_all" @echo " " @echo "Check links after installation : " @echo "\$$ make htmllinkchecka" @echo " " before : @mkdir -p $(DIRWWW)/manuals/man/man1/ @mkdir -p $(DIRWWW)/manuals/html/sphinx/ @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/ @mkdir -p $(DIRWWW)/src_browser/ install_all : \ install_html \ install_pdf \ install_browser install_html : @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/html/ -u $(URLPUBLISH)/html/ install_pdf : @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/pdf/ -u $(URLPUBLISH)/pdf/ install_browser : @$(DIRADM)/install.sh -w $(DIRWWW)/src_browser/doxygen/html/ -u $(URLPUBLISH)/src_browser/doxygen/html/ clean : \ cleantmp -@rm -fr $(DIRWWW)/manuals/man/ -@rm -fr $(DIRWWW)/manuals/html/ -@rm -fr $(DIRWWW)/manuals/pdf/ -@rm -fr $(DIRWWW)/src_browser/ cleantmp : -@rm -f $(DIRTMP)/all.xml -@rm -f $(DIRTMP)/*.tex -@rm -fr $(DIRTMP)/sphinx_tmpdir/ -@rm -f $(DIRTMP)/sphinx_*.log design : \ $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \ $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg htmllinkcheckb : @$(DIRADM)/linkchecker.sh -d $(DIRWWW)/manuals/html/ htmllinkchecka : @$(DIRADM)/linkchecker.sh -u $(URLPUBLISH) spellcheck : @++aspell --mode=sgml --master=english -c \ $(DIRSRC)/$(PRODUCT).xml all : \ man \ html_src_browser man : \ man_troff \ html \ pdf \ html_src_browser : \ html_src_browser_doxygen man_troff : \ man_troff_sphinx man_troff_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFORTRAN_RST) @sphinx-build -b man -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW)/manuals/man/man1/ html : \ html_sphinx \ html_sphinx_one html_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFORTRAN_RST) @sphinx-build -b html -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW)/manuals/html/sphinx/ html_sphinx_one : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFORTRAN_RST) @sphinx-build -b singlehtml -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW)/manuals/html/sphinx_one/ pdf : \ pdf_sphinx pdf_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFORTRAN_RST) @sphinx-build -b latex -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_pdf.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRTMP)/sphinx_tmpdir/latex_output cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \ $(DIRWWW)/manuals/pdf/sphinx/ $(DIRTMP)/sphinx_tmpdir/index.rst : @echo ".. _index:" > $@ @echo " " >> $@ @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ @echo "$(PRODUCTNAME) manuals" >> $@ @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ @echo " " >> $@ @echo "Shell scripts" >> $@ @echo "Shell scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCSH); \ do \ echo " manuals/$$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "MATLAB scripts" >> $@ @echo "MATLAB scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCMATLAB); \ do \ echo " manuals/$$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "Fortran Sources" >> $@ @echo "Fortran Sources" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCFORTRAN); \ do \ echo " manuals/$$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "Indices and tables" >> $@ @echo "Indices and tables" | tr [:print:] = >> $@ @echo "* :ref:\`search\`" >> $@ @echo " " >> $@ html_src_browser_doxygen : \ $(DIRWWW)/src_browser/doxygen/ $(DIRWWW)/src_browser/doxygen/ : \ $(DIRADM)/Doxyfile_$(PRODUCT) \ $(LIST_SRCMATLAB) \ $(LIST_SRCFORTRAN) @doxygen $< @touch $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.sh.rst : $(DIRSRC)/%.sh $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/%.m $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/mode_sahelien/%.m $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/SIMULS_IRCAAM/%.m $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.F90.rst : $(DIRSRC)/SIMULS_IRCAAM/%.F90 $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l fortran -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.f.rst : $(DIRSRC)/%.f $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l fortran -o $@ $(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg @convert $< $@ $(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot @dot -Tsvg -o $@ $< $(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \ ./makefile @makeppgraph --graphviz --output=$@