Browse Source

sphinx documentation: fix requirements check; move rst files into src/ directory for wxgui

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61152 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 11 years ago
parent
commit
2c71e72f93

+ 40 - 16
gui/wxpython/docs/wxgui_sphinx/Makefile

@@ -6,6 +6,26 @@ include $(MODULE_TOPDIR)/include/Make/Rules.make
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
+APIDOC := $(shell sphinx-apidoc2 --help 2>/dev/null)
+ifdef APIDOC
+SPHINXAPIDOC = sphinx-apidoc2
+else
+    APIDOC := $(shell sphinx-apidoc --help 2>/dev/null)
+    ifdef APIDOC
+	SPHINXAPIDOC = sphinx-apidoc
+    endif
+endif
+
+BUILD := $(shell sphinx-build2 --version 2>/dev/null)
+ifdef BUILD
+    SPHINXBUILD = sphinx-build2
+else
+    BUILD := $(shell sphinx-build --version 2>/dev/null)
+    ifdef BUILD
+	SPHINXBUILD = sphinx-build
+    endif
+endif
+
 
 PAPER         =
 BUILDDIR      = _build
@@ -16,7 +36,7 @@ MYGISBASE = $(GISBASE)
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . src/
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
@@ -24,20 +44,6 @@ I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
 .DEFAULT_GOAL := help
 
-ifneq (@(type sphinx-apidoc2 > /dev/null),)
-SPHINXAPIDOC   = sphinx-apidoc2
-endif
-ifneq (@(type sphinx-apidoc > /dev/null),)
-SPHINXAPIDOC   = sphinx-apidoc
-endif
-
-ifneq (@(type sphinx-build2 > /dev/null),)
-SPHINXBUILD   = sphinx-build2
-endif
-ifneq (@(type sphinx-build > /dev/null),)
-SPHINXBUILD   = sphinx-build
-endif
-
 
 wxguihelp:
 	@echo "Please use \`make <target>' where <target> is one of"
@@ -52,10 +58,28 @@ wxguihelp:
 
 wxguiclean:
 	-rm -rf $(BUILDDIR)/*
+	-rm -rf src/a*.rst
+	-rm -rf src/c*.rst
+	-rm -rf src/d*.rst
+	-rm -rf src/g*.rst
+	-rm -rf src/ic*.rst
+	-rm -rf src/is*.rst
+	-rm -rf src/l*.rst
+	-rm -rf src/m*.rst
+	-rm -rf src/n*.rst
+	-rm -rf src/p*.rst
+	-rm -rf src/r*.rst
+	-rm -rf src/t*.rst
+	-rm -rf src/v*.rst
+	-rm -rf src/web_services.rst
+	-rm -rf src/wxgui.rst
+	-rm -rf src/wxplot.rst
 	-rm -f _templates/layout.html
 
 wxguiapidoc:
-	$(call run_grass, $(SPHINXAPIDOC) -T -f -o . ../../)
+	@echo $(SPHINXAPIDOC)
+	@echo $(SPHINXBUILD)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../../)
 	
 wxguihtml:
 	$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))

gui/wxpython/docs/wxgui_sphinx/index.rst → gui/wxpython/docs/wxgui_sphinx/src/index.rst


gui/wxpython/docs/wxgui_sphinx/wxgui_libraries.rst → gui/wxpython/docs/wxgui_sphinx/src/wxgui_libraries.rst


gui/wxpython/docs/wxgui_sphinx/wxgui_tools.rst → gui/wxpython/docs/wxgui_sphinx/src/wxgui_tools.rst


+ 18 - 10
include/Make/Sphinx.make

@@ -1,18 +1,26 @@
-ifneq (@(type sphinx-apidoc2 > /dev/null),)
-SPHINXAPIDOC   = sphinx-apidoc2
-endif
-ifneq (@(type sphinx-apidoc > /dev/null),)
-SPHINXAPIDOC   = sphinx-apidoc
+APIDOC := $(shell sphinx-apidoc2 --help 2>/dev/null)
+ifdef APIDOC
+SPHINXAPIDOC = sphinx-apidoc2
+else
+    APIDOC := $(shell sphinx-apidoc --help 2>/dev/null)
+    ifdef APIDOC
+	SPHINXAPIDOC = sphinx-apidoc
+    endif
 endif
 
-ifneq (@(type sphinx-build2 > /dev/null),)
-SPHINXBUILD   = sphinx-build2
-endif
-ifneq (@(type sphinx-build > /dev/null),)
-SPHINXBUILD   = sphinx-build
+BUILD := $(shell sphinx-build2 --version 2>/dev/null)
+ifdef BUILD
+    SPHINXBUILD = sphinx-build2
+else
+    BUILD := $(shell sphinx-build --version 2>/dev/null)
+    ifdef BUILD
+	SPHINXBUILD = sphinx-build
+    endif
 endif
 
 checksphinx:
+	@echo $(SPHINXBUILD)
+	@echo $(SPHINXAPIDOC)
 	@(type $(SPHINXBUILD) > /dev/null || (echo "ERROR: Install 'sphinx-build' software first (get from http://sphinx-doc.org)" && exit 1))
 	@(type $(SPHINXAPIDOC) > /dev/null || (echo "ERROR: Install 'sphinx-apidoc' software first (get from http://sphinx-doc.org)" && exit 1))
 

+ 25 - 10
lib/python/docs/Makefile

@@ -6,12 +6,27 @@ include $(MODULE_TOPDIR)/include/Make/Rules.make
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
-ifneq (@(type sphinx-build2 > /dev/null),)
-SPHINXBUILD   = sphinx-build2
+APIDOC := $(shell sphinx-apidoc2 --help 2>/dev/null)
+ifdef APIDOC
+SPHINXAPIDOC = sphinx-apidoc2
+else
+    APIDOC := $(shell sphinx-apidoc --help 2>/dev/null)
+    ifdef APIDOC
+	SPHINXAPIDOC = sphinx-apidoc
+    endif
 endif
-ifneq (@(type sphinx-build > /dev/null),)
-SPHINXBUILD   = sphinx-build
+
+BUILD := $(shell sphinx-build2 --version 2>/dev/null)
+ifdef BUILD
+    SPHINXBUILD = sphinx-build2
+else
+    BUILD := $(shell sphinx-build --version 2>/dev/null)
+    ifdef BUILD
+	SPHINXBUILD = sphinx-build
+    endif
 endif
+
+
 PAPER         =
 BUILDDIR      = _build
 BUILDDIR_HTML = $(HTMLDIR)/libpython
@@ -51,12 +66,12 @@ libpythonclean:
 	-rm -f src/temporal.rst
 
 libpythonapidoc:
-#	$(call run_grass, sphinx-apidoc -T -f -o src/ ../ctypes/)
-	$(call run_grass,sphinx-apidoc -T -f -o src/ ../imaging/)
-	$(call run_grass,sphinx-apidoc -T -f -o src/ ../pydispatch/)
-	$(call run_grass,sphinx-apidoc -T -f -o src/ ../pygrass/)
-	$(call run_grass,sphinx-apidoc -T -f -o src/ ../script/)
-	$(call run_grass,sphinx-apidoc -T -f -o src/ ../temporal/)
+	@echo $(SPHINXAPIDOC)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../imaging/)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../pydispatch/)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../pygrass/)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../script/)
+	$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../temporal/)
 	
 libpythonhtml:
 	$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))