Index: /trunk/adm/makefile
===================================================================
--- /trunk/adm/makefile	(revision 3)
+++ /trunk/adm/makefile	(revision 3)
@@ -0,0 +1,224 @@
+#+
+#
+# .. _makefile:
+#
+# ========
+# makefile
+# ========
+#
+# surcouche génération des documentations 
+#
+# TODO
+# ====
+#
+# autodoc not ok may be see  autodoc-process-docstring 
+#
+# sort pb within index_manuals for matlab scripts because severals
+# directories. and for probably the same reason no next/previous
+# continuation
+#
+# add -W to sphinx command when encoding problems are solved
+#
+# IDL and matlab in man_troff
+#
+# saxo inventory file should be provide by SAXO itself
+#
+# remove "-" before extract_demandandtest.sh : It is known now (20110303)
+# that all demo and test are not ready but they should be at least on per
+# file.
+#
+# find a way to order tests : now alphanumeric order (non-sens)
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: makefile 518 2012-04-13 13:05:27Z pinsard $
+#
+# $URL$
+#
+# - fplod 20120424
+#
+#   * creation
+#
+# SEE ALSO
+# ========
+#
+# :ref:`extract_rst.sh`
+#
+#-
+#
+PRODUCT = \
+twice
+
+PRODUCTNAME = \
+$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
+
+SUBPRODUCT = \
+twice_ws
+
+DIRSRC = \
+../src/
+
+DIRADM = \
+./
+
+DIRTMP = \
+./
+
+DIRDESIGN = \
+./design/
+
+DIRWWW_DEV = \
+../doc/
+
+URLPUBLISH = \
+http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/doc/
+
+LIST_INVENTORY = \
+$(DIRADM)/saxo.inv
+
+LIST_SRCMATLAB_DEMO = \
+$(shell echo "$(LIST_SRCMATLAB)" | \
+	sed -e "s+$(DIRSRC)+$(DIRTMP)/demo/+g" \
+	    -e "s+\.m+_demo.m+g")
+
+LIST_SRCMATLAB_TEST = \
+$(shell echo "$(LIST_SRCMATLAB)" | \
+	sed -e "s+$(DIRSRC)+$(DIRTMP)/test/+g" \
+	    -e "s+\.m+_test.m+g")
+
+LIST_SRCPYTHON = \
+$(shell find $(DIRSRC) -name "*.py" | sort)
+
+.PHONY : \
+help \
+before \
+clean \
+cleantmp \
+design \
+htmllinkcheckb \
+htmllinkchecka \
+spellcheck \
+all \
+man \
+man_troff_sphinx \
+html \
+html_sphinx \
+html_sphinx_one \
+pdf \
+pdf_sphinx \
+matlab_demo \
+matlab_test
+
+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 $(DIRTMP)/demo/
+	@mkdir -p $(DIRTMP)/test/
+
+
+install_all : \
+install_html \
+install_pdf
+
+install_html :
+	@install.sh -w $(DIRWWW_DEV)/html/ -u $(URLPUBLISH)/html/
+
+install_pdf :
+	@install.sh -w $(DIRWWW_DEV)/latex/ -u $(URLPUBLISH)/latex
+
+clean : \
+cleantmp
+	cd ../docs/docs_dev/; make clean
+
+cleantmp :
+	@-rm $(DIRADM)/_static/logo.png
+	@-rm $(DIRWWW_DEV)/latex/*.aux \
+	$(DIRWWW_DEV)/latex/*.idx \
+	$(DIRWWW_DEV)/latex/*.ilg \
+	$(DIRWWW_DEV)/latex/*.ind \
+	$(DIRWWW_DEV)/latex/*.log \
+	$(DIRWWW_DEV)/latex/*.out \
+	$(DIRWWW_DEV)/latex/*.tex \
+	$(DIRWWW_DEV)/latex/*.toc \
+	$(DIRWWW_DEV)/latex/*.sty \
+	$(DIRWWW_DEV)/latex/*.ist \
+	$(DIRWWW_DEV)/latex/*.cls \
+	$(DIRWWW_DEV)/latex/graphviz-*.pdf \
+	$(DIRWWW_DEV)/latex/Makefile
+	-@rm -rf $(DIRTMP)/demo/
+	-@rm -rf $(DIRTMP)/test/
+
+design : \
+$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \
+$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg
+
+htmllinkcheckb :
+	@$(DIRADM)/linkchecker.sh -d $(DIRWWW_DEV)/html/
+
+htmllinkchecka :
+	@$(DIRADM)/linkchecker.sh -u $(URLPUBLISH)
+
+spellcheck :
+	@++aspell --mode=sgml --master=english -c \
+	$(DIRSRC)/$(PRODUCT).xml
+
+all : \
+all_dev
+
+all_dev : \
+html_dev \
+pdf_dev \
+man_dev
+
+html : \
+html_dev
+
+html_dev :
+	cd ../docs/docs_dev; make html
+
+pdf : \
+pdf_dev
+
+pdf_dev :
+	cd ../docs/docs_dev; make latexpdf
+
+man_dev :
+	cd ../docs/docs_dev; make man
+
+matlab_demo : \
+$(LIST_SRCMATLAB_DEMO)
+
+matlab_test : \
+$(LIST_SRCMATLAB_TEST)
+
+$(DIRTMP)/demo/%_demo.m : $(DIRSRC)/%.m $(DIRADM)/extract_demoandtest.sh
+	-@$(DIRADM)/extract_demoandtest.sh -i $< -m demo -o $@
+
+$(DIRTMP)/test/%_test.m : $(DIRSRC)/%.m $(DIRADM)/extract_demoandtest.sh
+	-@$(DIRADM)/extract_demoandtest.sh -i $< -m test -o $@
+
+$(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg
+	@convert $< $@
+
+$(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot
+	@dot -Tsvg -o $@ $<
+
+$(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \
+./makefile
+	@makeppgraph --graphviz --output=$@
