# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SOURCEDIR = . BUILDDIR = _build MODULES = $(sort \ state_machine\ stringtools\ stringtools.csp\ stringtools.stp\ ) # Put it first so that "make" without argument is like "make help". .PHONY: all help Makefile all: clean index.rst $(MODULES) html help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). html: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) clean: Makefile rm -f *.rst @for module in $(MODULES) ; do \ if [ -d "$$module/_examples_" ]; then make --no-print-directory -C $$module/_examples_ clean; fi \ #if [-d "$$module/_examples_" ]; then make --no-print-directory -C $$module/_examples_ clean; fi\ done @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) index.rst: Makefile @echo Generating $@ @echo "Indices and tables\n==================\n\n* :ref:\`genindex\`\n* :ref:\`modindex\`\n* :ref:\`search\`\n" > $@ @echo "Modules\n=======\n\n.. toctree::\n :maxdepth: 2\n" >> $@ %: Makefile @echo "Preparing $@" @echo ".. automodule:: $@\n :members:" > $@.rst @if [ "$(findstring .,$@)" != "." ]; then \ git -C $@ checkout master; \ git -C $@ pull; \ make -C $@/_examples_ clean all; \ fi @echo " $@.rst" >> index.rst; \