Salome HOME
0021196: [CEA 456] Integration and merge modification for debian packages
[modules/geom.git] / doc / docutils / Makefile.am
1 #  -*- coding: iso-8859-1 -*-
2 #  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 #  This library is free software; you can redistribute it and/or
8 #  modify it under the terms of the GNU Lesser General Public
9 #  License as published by the Free Software Foundation; either
10 #  version 2.1 of the License.
11 #
12 #  This library is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 #  Lesser General Public License for more details.
16 #
17 #  You should have received a copy of the GNU Lesser General Public
18 #  License along with this library; if not, write to the Free Software
19 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22
23 include $(top_srcdir)/adm_local/unix/make_common_starter.am
24
25 pydocdir = $(docdir)/tui/GEOM/docutils
26
27 .PHONY : latex
28
29 if SPHINX_IS_OK
30
31 html/index.html:$(RSTFILES)
32         make htm
33
34 usr_docs: html/index.html
35
36 endif
37
38 EXTRA_DIST+= images
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
46 SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
47
48 SPHINX_LD_LIBRARY_PATH = $(KERNEL_ROOT_DIR)/lib/salome:$(OMNIORB_ROOT)/lib
49
50 htm:
51         mkdir -p html doctrees
52         PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
53         LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
54         $(SPHINXBUILD) -c $(top_builddir)/doc/docutils -W -b html $(ALLSPHINXOPTS) html
55         @echo
56         @echo "Build finished. The HTML pages are in html."
57
58 latex:
59         mkdir -p latex doctrees
60         PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
61         LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
62         $(SPHINXBUILD) -c $(top_builddir)/doc/docutils -W -b latex $(ALLSPHINXOPTS) latex
63         @echo
64         @echo "Build finished; the LaTeX files are in latex."
65         @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
66               "run these through (pdf)latex."
67
68 html:
69         mkdir -p $@
70
71 RSTFILES= \
72         index.rst \
73         overview.rst \
74         docapi.rst
75
76 EXTRA_DIST+= $(RSTFILES)
77
78 install-data-local:
79         test -z $(pydocdir) || mkdir -p $(DESTDIR)$(pydocdir)
80         if test -d "html"; then b=; else b="$(srcdir)/"; fi; \
81         cp -rf $$b"html"/* $(pydocdir) ; \
82         if test -f $$b"latex"/geompy.pdf; then cp -f $$b"latex"/geompy.pdf $(pydocdir) ; fi;
83
84 uninstall-local:
85         -test -d $(pydocdir) && chmod -R +w $(pydocdir) && rm -rf $(pydocdir)/*
86
87 clean-local:
88         -rm -rf html latex doctrees
89         if test -d "html"; then rm -rf html ; fi
90
91 disthook :
92         -test -d html && cp -Rp html $(distdir)