]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/MEDOP/doc/sphinx/Makefile.am
Salome HOME
Fix problem of make distcheck
[tools/medcoupling.git] / src / MEDOP / doc / sphinx / Makefile.am
1 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # author: Guillaume Boulant (EDF/R&D, 2012)
21
22 include $(top_srcdir)/adm_local/unix/make_common_starter.am
23
24 tuidocdir = $(docdir)/tui/MED
25 devdocdir = $(docdir)/dev/MED
26 medopdocdir=$(devdocdir)
27
28 .PHONY : latex
29
30 if SPHINX_IS_OK
31
32 medopdoc_DATA=html/index.html
33 html/index.html:$(RSTFILES)
34         make htm
35
36 endif
37
38 EXTRA_DIST += html
39
40 SPHINXOPTS      =
41 SOURCEDIR       = $(srcdir)
42 SPHINXBUILD     = sphinx-build
43 PAPEROPT_a4     = -D latex_paper_size=a4
44 ALLSPHINXOPTS   = -d doctrees $(PAPEROPT_a4) $(SPHINXOPTS) $(SOURCEDIR)
45 SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages
46
47 CONF_PATH = $(top_builddir)/src/MEDOP/doc/sphinx
48
49 SPHINX_LD_LIBRARY_PATH = $(OMNIORB_ROOT)/lib
50
51 htm:
52         mkdir -p html doctrees
53         PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH}; \
54         LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH}; \
55         $(SPHINXBUILD) -c $(CONF_PATH) -b html $(ALLSPHINXOPTS) html
56         @echo
57         @echo "Build finished. The HTML pages are in html."
58
59 latex:
60         mkdir -p latex doctrees
61         PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH}; \
62         LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH}; \
63         $(SPHINXBUILD) -c $(CONF_PATH) -b latex $(ALLSPHINXOPTS) latex
64         @echo
65         @echo "Build finished; the LaTeX files are in latex."
66         @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
67               "run these through (pdf)latex."
68
69 html:
70         mkdir -p $@
71
72 RSTFILES= \
73         index.rst               \
74         xmed-specifications.rst \
75         xmed-develguide.rst     \
76         xmed-userguide.rst
77
78 # Files on the development of the prototype (version 2010)
79 RSTFILES+=\
80         xmed-prototype-overview.rst     \
81         xmed-prototype-develguide.rst   \
82         xmed-prototype-medmem.rst
83
84 # Files containing definitions and references
85 RSTFILES+=\
86         xmed-definitions.rst \
87         xmed-references.rst  \
88         xmed-workingnotes-2010.rst \
89         xmed-workingnotes-2011.rst \
90         xmed-workingnotes-2012.rst
91
92 # Files on annexe topics
93 RSTFILES+=\
94         salomedoc.rst
95
96 EXTRA_DIST+= $(RSTFILES)
97
98 EXTRA_DIST+= \
99         conf.py \
100         _static \
101         images
102
103 install-data-local:
104         $(INSTALL) -d $(DESTDIR)$(medopdocdir)
105         if test -d "html"; then b=; else b="$(srcdir)/"; fi; \
106         cp -rf $$b"html"/* $(DESTDIR)$(medopdocdir) ; \
107         if test -f $$b"latex"/medopdoc.pdf; then cp -f $$b"latex"/medopdoc.pdf $(DESTDIR)$(medopdocdir) ; fi;
108
109 uninstall-local:
110         chmod -R +w $(DESTDIR)$(medopdocdir)
111         rm -rf $(DESTDIR)$(medopdocdir)/*
112
113 clean-local:
114         -chmod -R +w html latex doctrees
115         rm -rf html latex doctrees
116         if test -d "html"; then rm -rf html ; fi
117
118 pdf: latex
119         cd latex; make all-pdf
120         cp latex/*.pdf html/_static/documents/.
121
122 WIKIRELATIVEPATH="pub/userdata/gboulant/data/salome/smodules/xmed/doc"
123 WIKIREMOTEPATH="nepal@nepal:/nepal/$(WIKIRELATIVEPATH)"
124 deploy: htm pdf
125         rsync -avz html/ $(WIKIREMOTEPATH)
126         @echo "The documentation can be read at URL : http://nepal.der.edf.fr/$(WIKIRELATIVEPATH)/index.html"