#+ # # ======== # makefile # ======== # # --------------------------------------- # generation of documentation of superbib # --------------------------------------- # # TODO # ==== # # add -W to sphinx command when encoding problems are solved # # usage of sphinx/source/Makefile # # revision of manual section of php and xsl # # EVOLUTIONS # ========== # # $Id$ # # - fplod 20100621T074833Z aedon.locean-ipsl.upmc.fr (Darwin) # # * remove most of docutils # * singlehtml with sphinx # # - fplod 20100419T145702Z aedon.locean-ipsl.upmc.fr (Darwin) # # * remove rest2web (sphinx is prefered) # # - fplod 20100323T135104Z aedon.locean-ipsl.upmc.fr (Darwin) # # * remove one pdf and html # # - fplod 20100311T143131Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add rest2web (alternative to sphinx) # # - fplod 20100310T190253Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add php and xsl files to man_troff # # - fplod 20100310T182201Z aedon.locean-ipsl.upmc.fr (Darwin) # # * usage of sphinx (for the first time !) not yet ok ... # # - fplod 20100310T091541Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add man_troff with shell scripts possible now with docutils 0.6 # can be test with # $ man -M ../doc//manuals/man bibopa.sh # # - fplod 2009-05-13T14:08:49Z 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 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 2008-10-28T10:59:44Z aedon.locean-ipsl.upmc.fr (Darwin) # # * add newpage directive # (thanks to http://docutils.sourceforge.net/docs/user/latex.html) # # - fplod 2008-09-17T09:16:08Z aedon.locean-ipsl.upmc.fr (Darwin) # * add xsl files # # - fplod 2008-09-16T14:59:02Z aedon.locean-ipsl.upmc.fr (Darwin) # * creation # # SEE ALSO # ======== # # extract_rst.sh_ # # .. _extract_rst.sh: ../extract_rst.sh.html # #- # PRODUCT = \ superbib PRODUCTNAME = \ $$(echo $(PRODUCT) | tr [:lower:] [:upper:]) DIRSRC = \ ../ DIRADM = \ ./ DIRTMP = \ ./ DIRDESIGN = \ ./design/ DIRWWW = \ ../doc/ URLPUBLISH = \ http://www.locean-ipsl.upmc.fr/~fplod/projects/$(PRODUCT) LIST_SRCPHP = \ $(DIRSRC)/timestamp.php LIST_SRCPHP_RST = \ $(shell echo "$(LIST_SRCPHP)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/+g" \ -e "s+\.php+.php.rst+g") LIST_SRCPHP_R2W = \ $(shell echo "$(LIST_SRCPHP)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ -e "s+\.php+.php.txt+g") LIST_SRCPHP_TROFF = \ $(shell echo "$(LIST_SRCPHP)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ -e "s+\.php+.php.1+g") LIST_SRCPHP_HTML = \ $(shell echo "$(LIST_SRCPHP)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ -e "s+\.php+.php.html+g") LIST_SRCPHP_PDF = \ $(shell echo "$(LIST_SRCPHP)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ -e "s+\.php+.php.pdf+g") LIST_SRCXSL = \ $(DIRSRC)/components_db.xsl \ $(DIRSRC)/form_db.xsl \ $(DIRSRC)/main_html.xsl \ $(DIRSRC)/message_lang.xsl \ $(DIRSRC)/superbib01_html.xsl \ $(DIRSRC)/superbib01_xml.xsl \ $(DIRSRC)/superbib02_html.xsl \ $(DIRSRC)/superbib02_xml.xsl \ $(DIRSRC)/superbibmany01_html.xsl \ $(DIRSRC)/superbibmany01_xml.xsl \ $(DIRSRC)/superbibmany02_html.xsl \ $(DIRSRC)/superbibmany02_xml.xsl \ $(DIRSRC)/template_db.xsl \ $(DIRSRC)/user_db.xsl \ $(DIRSRC)/user_html.xsl LIST_SRCXSL_RST = \ $(shell echo "$(LIST_SRCXSL)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)+g" \ -e "s+\.xsl+.xsl.rst+g") LIST_SRCXSL_R2W = \ $(shell echo "$(LIST_SRCXSL)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ -e "s+\.xsl+.xsl.txt+g") LIST_SRCXSL_TROFF = \ $(shell echo "$(LIST_SRCXSL)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ -e "s+\.xsl+.xsl.1+g") LIST_SRCXSL_HTML = \ $(shell echo "$(LIST_SRCXSL)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ -e "s+\.xsl+.xsl.html+g") LIST_SRCXSL_PDF = \ $(shell echo "$(LIST_SRCXSL)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ -e "s+\.xsl+.xsl.pdf+g") LIST_SRCSH = \ $(DIRSRC)/$(PRODUCT)_profile.sh \ $(DIRSRC)/before.sh \ $(DIRSRC)/bibopa.sh \ $(DIRSRC)/install.sh \ $(DIRSRC)/linkchecker.sh \ $(DIRSRC)/mailtouser.sh \ $(DIRSRC)/twindoi.sh LIST_SRCSH_RST = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)+g" \ -e "s+\.sh+.sh.rst+g") LIST_SRCSH_R2W = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \ -e "s+\.sh+.sh.txt+g") LIST_SRCSH_TROFF = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \ -e "s+\.sh+.sh.1+g") LIST_SRCSH_HTML = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \ -e "s+\.sh+.sh.html+g") LIST_SRCSH_PDF = \ $(shell echo "$(LIST_SRCSH)" | \ sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \ -e "s+\.sh+.sh.pdf+g") .PHONY : \ help \ before \ clean \ cleantmp \ design \ htmllinkcheckb \ htmllinkchecka \ spellcheck \ all \ man \ man_troff_sphinx \ man_html \ man_html_sphinx \ man_html_sphinx_one \ man_pdf \ man_pdf_sphinx 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" @echo "\$$ make install" @echo " " @echo "Check links after installation : " @echo "\$$ make htmllinkchecka" @echo " " before : @mkdir -p $(DIRWWW)/manuals/man/man1/ @mkdir -p $(DIRWWW)/manuals/html/rest2web/ @mkdir -p $(DIRWWW)/manuals/html/rest2web/css/ @mkdir -p $(DIRWWW)/manuals/html/sphinx/ @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/ @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/ @mkdir -p $(DIRTMP)/rest2web_tmpdir/ install : @install.sh -w $(DIRWWW) -u $(URLPUBLISH) clean : \ cleantmp -@rm -fr $(DIRWWW)/ -@rm -fr $(DIRWWW)/manuals/man/ -@rm -fr $(DIRWWW)/manuals/html/ -@rm -fr $(DIRWWW)/manuals/pdf/ cleantmp : -@rm -f $(DIRTMP)/all.xml -@rm -f $(DIRTMP)/*.rst -@rm -f $(DIRTMP)/*.tex -@rm -rf $(DIRTMP)/rest2web_tmpdir/ -@rm -f $(DIRTMP)/rest2web.log -@rm -rf $(DIRTMP)/sphinx_tmpdir/ -@rm -f $(DIRTMP)/sphinx_*.log design : \ $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \ $(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg htmllinkcheckb : @linkchecker.sh -d $(DIRWWW)/manuals/html/ htmllinkchecka : @linkchecker.sh -u $(URLPUBLISH) spellcheck : @++aspell --mode=sgml --master=francais -c \ $(DIRSRC)/$(PRODUCT).xml all : \ man man : \ man_troff \ man_html \ man_pdf man_troff : \ man_troff_sphinx man_troff_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCXSL_RST) \ $(LIST_SRCPHP_RST) @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ @sphinx-build -b man -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW)/manuals/man/man1/ man_html : \ man_html_sphinx \ man_html_sphinx_one man_html_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCXSL_RST) \ $(LIST_SRCPHP_RST) @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ @sphinx-build -b html -c $(DIRADM)/sphinx \ -d $(DIRTMP)/sphinx_tmpdir/doctrees \ -w $(DIRTMP)/sphinx_html.log \ $(DIRTMP)/sphinx_tmpdir/ \ $(DIRWWW)/manuals/html/sphinx/ man_html_sphinx_one : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCXSL_RST) \ $(LIST_SRCPHP_RST) @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ @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/ man_pdf : \ man_pdf_sphinx man_pdf_sphinx : \ $(DIRADM)/sphinx/conf.py \ $(DIRTMP)/sphinx_tmpdir/index.rst \ $(LIST_SRCSH_RST) \ $(LIST_SRCXSL_RST) \ $(LIST_SRCPHP_RST) @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCXSL_RST) $(DIRTMP)/sphinx_tmpdir/ @cp $(LIST_SRCPHP_RST) $(DIRTMP)/sphinx_tmpdir/ @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 " $$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "XSL scripts" >> $@ @echo "XSL scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCXSL); \ do \ echo " $$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "PHP scripts" >> $@ @echo "PHP scripts" | tr [:print:] = >> $@ @echo ".. toctree::" >> $@ @echo " :maxdepth: 1" 1>> $@ @echo " :glob:" 1>> $@ @echo " " >> $@ @for file in $(LIST_SRCPHP); \ do \ echo " $$(basename $${file})"; \ done >> $@ @echo " " >> $@ @echo "Indices and tables" >> $@ @echo "Indices and tables" | tr [:print:] = >> $@ @echo "* :ref:\`search\`" >> $@ @echo " " >> $@ $(DIRTMP)/%.sh.rst : $(DIRSRC)/%.sh @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@ $(DIRTMP)/%.xsl.rst : $(DIRSRC)/%.xsl @$(DIRADM)/extract_rst.sh -i $< -l xml -o $@ $(DIRTMP)/%.php.rst : $(DIRSRC)/%.php @$(DIRADM)/extract_rst.sh -i $< -l php -o $@ $(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg @convert $< $@ $(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot @dot -Tsvg -o $@ $< $(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \ ./makefile @makeppgraph --graphviz --output=$@