#+ # # .. _makefile: # # ======== # makefile # ======== # # génération des manuels tropflux # # TODO # ==== # # add -W to sphinx command when encoding problems are solved # # usage of sphinx/source/Makefile # # IDL and matlab in man_troff # # pb with automodule for python path # # EVOLUTIONS # ========== # # - fplod 20110421T160731Z aedon.locean-ipsl.upmc.fr (Darwin) # # * correction for pdf_user # # - fplod 20110411T160342Z aedon.locean-ipsl.upmc.fr (Darwin) # # * handle paper01/fig*/*.pro (quite ugly !!) # # - fplod 20110401T091241Z aedon.locean-ipsl.upmc.fr (Darwin) # # * replace URLPUBLISH by URLPUBLISH_DEV # * replace DIRWWW by DIRWWW_DEV # * add URLPUBLISH_USER and DIRWWW_USER to handle website # # - fplod 20110203T101853Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add cdo inventory file for sphinx intermapping # # - fplod 20110110T165518Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add odv files # # - fplod 20110106T135021Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add matlab, ferret files # # - fplod 20101223T083725Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add nco inventory file for sphinx intermapping # # - fplod 20101220T092552Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add saxo inventory file for sphinx intermapping # # - fplod 20101118T165524Z aedon.locean-ipsl.upmc.fr (Darwin) # # * creation # # SEE ALSO # ======== # # :ref:`extract_rst.sh` # #- # PRODUCT = \ tropflux PRODUCTNAME = \ $$(echo $(PRODUCT) | tr [:lower:] [:upper:]) SUBPRODUCT = \ tropflux_ws DIRSRC = \ ../src/ DIRADM = \ ./ DIRTMP = \ ./ DIRDESIGN = \ ./design/ DIRWWW_DEV = \ ../doc/ DIRWWW_USER = \ ./website/_build/ URLPUBLISH_DEV = \ http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/doc/ URLPUBLISH_USER = \ http://www.locean-ipsl.upmc.fr/~tropflux LIST_INVENTORY = \ $(DIRADM)/saxo.inv \ $(DIRADM)/nco.inv \ $(DIRADM)/cdo.inv LIST_RST_GUIDES = \ $(shell find $(DIRADM)/guides/ -name "*.rst") LIST_SRCSH = \ $(shell find $(DIRSRC) -name "*.sh" | sort) 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_DEV)/man/man1/+g" \ -e "s+\.sh+.sh.1+g") LIST_SRCIDL = \ $(shell find $(DIRSRC) -name "*.pro" | sort) LIST_SRCIDL_RST = \ $(shell echo "$(LIST_SRCIDL)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \ -e "s+$(DIRSRC)/paper01/fig1+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig1+g" \ -e "s+$(DIRSRC)/paper01/fig2+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig2+g" \ -e "s+$(DIRSRC)/paper01/fig3+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig3+g" \ -e "s+$(DIRSRC)/paper01/fig4+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig4+g" \ -e "s+$(DIRSRC)/paper01/fig5+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig5+g" \ -e "s+$(DIRSRC)/paper01/fig6+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig6+g" \ -e "s+$(DIRSRC)/paper01/fig7+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig7+g" \ -e "s+$(DIRSRC)/paper01/fig8+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig8+g" \ -e "s+$(DIRSRC)/paper01/fig9+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig9+g" \ -e "s+$(DIRSRC)/paper01/fig10+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig10+g" \ -e "s+$(DIRSRC)/paper01/fig11+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig11+g" \ -e "s+$(DIRSRC)/paper01/fig12+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig12+g" \ -e "s+$(DIRSRC)/paper01/fig13+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig13+g" \ -e "s+$(DIRSRC)/paper01/fig14+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig14+g" \ -e "s+$(DIRSRC)/paper01/fig15+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig15+g" \ -e "s+$(DIRSRC)/paper01/fig16+$(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig16+g" \ -e "s+\.pro+.pro.rst+g") LIST_SRCMATLAB = \ $(DIRSRC)/test/project_startup.m \ $(DIRSRC)/test/read.m LIST_SRCMATLAB_RST = \ $(shell echo "$(LIST_SRCMATLAB)" | \ sed -e "s+$(DIRSRC)/test/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \ -e "s+\.m+.m.rst+g") LIST_SRCFERRET = \ $(DIRSRC)/test/read.jnl LIST_SRCFERRET_RST = \ $(shell echo "$(LIST_SRCFERRET)" | \ sed -e "s+$(DIRSRC)/test/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \ -e "s+\.jnl+.jnl.rst+g") LIST_SRCODV = \ $(DIRSRC)/test/read.cmd LIST_SRCODV_RST = \ $(shell echo "$(LIST_SRCODV)" | \ sed -e "s+$(DIRSRC)/test/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \ -e "s+\.cmd+.cmd.rst+g") LIST_SRCPYTHON = \ $(DIRSRC)/test/read.py .PHONY : \ help \ before \ clean \ cleantmp \ design \ htmllinkcheckb \ htmllinkchecka \ spellcheck \ all \ man \ man_troff_sphinx \ html \ html_dev \ html_dev_sphinx \ html_dev_sphinx_one \ html_user \ pdf \ pdf_dev \ pdf_dev_sphinx \ pdf_user \ 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_DEV)/man/man1/ @mkdir -p $(DIRWWW_DEV)/html/sphinx/ @mkdir -p $(DIRWWW_DEV)/pdf/sphinx/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig1 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig2 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig3 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig4 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig5 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig6 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig7 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig8 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig9 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig10 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig11 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig12 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig13 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig14 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig15 @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/paper01/fig16 @mkdir -p $(DIRTMP)/sphinx_tmpdir/guides/ @mkdir -p $(DIRWWW_DEV)/src_browser/ install_all : \ install_html_dev \ install_html_user \ install_pdf_dev \ install_pdf_user \ install_browser install_html_dev : @$(DIRADM)/install.sh -w $(DIRWWW_DEV)/html/ -u $(URLPUBLISH_DEV)/html/ install_html_user : @$(DIRADM)/install.sh -w $(DIRWWW_USER)/ -u $(URLPUBLISH_USER)/ install_pdf_dev : @$(DIRADM)/install.sh -w $(DIRWWW_DEV)/pdf/ -u $(URLPUBLISH_DEV)/pdf/ install_pdf_user : @$(DIRADM)/install.sh -w $(DIRWWW_USER)/pdf/ -u $(URLPUBLISH_USER)/pdf/ install_browser : @$(DIRADM)/install.sh -w $(DIRWWW_DEV)/src_browser/doxygen/html/ -u $(URLPUBLISH_DEV)/src_browser/doxygen/html/ clean : \ cleantmp -@rm -fr $(DIRWWW_DEV)/man/ -@rm -fr $(DIRWWW_DEV)/html/ -@rm -fr $(DIRWWW_DEV)/pdf/ -@rm -fr $(DIRWWW_DEV)/src_browser/ cd $(DIRADM)/website/; make clean cleantmp : -@rm -f $(DIRTMP)/all.xml -@rm -f $(DIRTMP)/*.txt -@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_DEV)/html/ @$(DIRADM)/linkchecker.sh -d $(DIRWWW_USER) htmllinkchecka : @$(DIRADM)/linkchecker.sh -u $(URLPUBLISH_DEV) @$(DIRADM)/linkchecker.sh -u $(URLPUBLISH_USER) spellcheck : @++aspell --mode=sgml --master=english -c \ $(DIRSRC)/$(PRODUCT).xml all : \ man \ html_src_browser html_src_browser : \ html_src_browser_doxygen man : \ man_troff_sphinx man_troff_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index_manuals.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCIDL_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFERRET_RST) \ $(LIST_SRCODV_RST) \ $(LIST_SRCPYTHON) @sphinx-build -b man -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees/ \ -d $(DIRTMP)/sphinx_tmpdir/doctrees/manuals/ \ -w $(DIRTMP)/sphinx_man_troff.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW_DEV)/man/man1/ html : \ html_user \ html_dev html_user : cd $(DIRADM)/website/; make html html_dev : \ html_dev_sphinx \ html_dev_sphinx_one html_dev_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRADM)/index.rst \ $(DIRADM)/index_guides.rst \ $(DIRTMP)/sphinx_tmpdir/index_manuals.rst \ $(LIST_INVENTORY) \ $(LIST_RST_GUIDES) \ $(LIST_SRCSH_RST) \ $(LIST_SRCIDL_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFERRET_RST) \ $(LIST_SRCODV_RST) \ $(LIST_SRCPYTHON) echo $(LIST_RST_GUIDES) @cp $(DIRADM)/index.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(DIRADM)/index_guides.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_RST_GUIDES) $(DIRTMP)/sphinx_tmpdir/guides/ @cp $(LIST_INVENTORY) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCPYTHON) $(DIRTMP)/sphinx_tmpdir/manuals/ @sphinx-build -b html -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW_DEV)/html/sphinx/ html_dev_sphinx_one : \ $(DIRADM)/sphinx/conf.py \ $(DIRADM)/index.rst \ $(DIRADM)/index_guides.rst \ $(DIRTMP)/sphinx_tmpdir/index_manuals.rst \ $(LIST_INVENTORY) \ $(LIST_RST_GUIDES) \ $(LIST_SRCSH_RST) \ $(LIST_SRCIDL_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFERRET_RST) \ $(LIST_SRCODV_RST) \ $(LIST_SRCPYTHON) @cp $(DIRADM)/index.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(DIRADM)/index_guides.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_RST_GUIDES) $(DIRTMP)/sphinx_tmpdir/guides/ @cp $(LIST_INVENTORY) $(DIRTMP)/sphinx_tmpdir/ @sphinx-build -b singlehtml -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html_one.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW_DEV)/html/sphinx_one/ pdf : \ pdf_user \ pdf_dev pdf_user : cd $(DIRADM)/website/; make latexpdf pdf_dev : \ pdf_dev_sphinx pdf_dev_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRADM)/index.rst \ $(DIRADM)/index_guides.rst \ $(DIRTMP)/sphinx_tmpdir/index_manuals.rst \ $(LIST_INVENTORY) \ $(LIST_RST_GUIDES) \ $(LIST_SRCSH_RST) \ $(LIST_SRCIDL_RST) \ $(LIST_SRCMATLAB_RST) \ $(LIST_SRCFERRET_RST) \ $(LIST_SRCODV_RST) \ $(LIST_SRCPYTHONS) @cp $(DIRADM)/index.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(DIRADM)/index_guides.rst $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_RST_GUIDES) $(DIRTMP)/sphinx_tmpdir/guides/ @cp $(LIST_INVENTORY) $(DIRTMP)/sphinx_tmpdir/ @sphinx-build -b latex -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_pdf_dev.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_DEV)/pdf/sphinx/ $(DIRTMP)/sphinx_tmpdir/index_manuals.rst : @-mkdir $(DIRTMP)/sphinx_tmpdir/ @echo ".. _index_manuals:" > $@ @echo " " >> $@ @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ @echo "$(PRODUCTNAME) manuals" >> $@ @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@ @echo " " >> $@ @echo ".. only:: html" >> $@ @echo " " >> $@ @echo " **Download** offline version (\`.pdf <../../pdf/sphinx/$(PRODUCTNAME).pdf>\`__)" >> $@ @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 "IDL scripts" >> $@ @echo "IDL scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCIDL); \ do \ echo " $${file}" | sed -e "s/src/manuals/"; \ 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 "FERRET scripts" >> $@ @echo "FERRET scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCFERRET); \ do \ echo " manuals/$$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "ODV scripts" >> $@ @echo "ODV scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCODV); \ do \ echo " manuals/$$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "PYTHON scripts" >> $@ @echo "PYTHON scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCPYTHON); \ do \ echo " .. automodule:: $$(basename $${file})"; \ done >> $@ @echo " .. automodule::" 1>> $@ @echo " :members:" 1>> $@ @echo " " >> $@ html_src_browser_doxygen : \ $(DIRWWW_DEV)/src_browser/doxygen/ $(DIRWWW_DEV)/src_browser/doxygen/ : \ $(DIRADM)/Doxyfile_$(PRODUCT) \ $(DIRADM)/m2cpp.pl \ $(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/%.pro.rst : $(DIRSRC)/%.pro $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l IDL -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/test/%.m $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.jnl.rst : $(DIRSRC)/test/%.jnl $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l ferret -o $@ $(DIRTMP)/sphinx_tmpdir/manuals/%.cmd.rst : $(DIRSRC)/test/%.cmd $(DIRADM)/extract_rst.sh @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@ $(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg @convert $< $@ $(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot @dot -Tsvg -o $@ $< $(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \ ./makefile @makeppgraph --graphviz --output=$@