docs/Makefile

67 lines
1.7 KiB
Makefile
Raw Normal View History

2021-01-03 21:34:20 +01:00
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
MODULES = $(sort \
caching\
2021-01-08 17:40:20 +01:00
fstools\
2021-01-06 23:02:39 +01:00
socket_protocol\
2021-01-03 21:34:20 +01:00
state_machine\
stringtools\
stringtools.csp\
stringtools.stp\
2021-01-07 18:14:11 +01:00
task\
2021-01-08 02:35:08 +01:00
tcp_socket\
2021-01-03 21:34:20 +01:00
)
# Put it first so that "make" without argument is like "make help".
.PHONY: all help Makefile
2021-01-07 18:14:11 +01:00
all: index.rst $(MODULES) html
2021-01-03 21:34:20 +01:00
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 \
done
2021-01-03 21:34:20 +01:00
@$(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; \
2021-01-07 18:14:11 +01:00
make -C $@/_examples_ all; \
2021-01-03 21:34:20 +01:00
fi
@echo " $@.rst" >> index.rst; \
2021-01-07 22:12:04 +01:00
update:
git pull
git submodule init
git submodule update
2021-01-07 22:12:04 +01:00
git submodule foreach git checkout master
git submodule foreach git pull
copy:
rsync -av --delete _build/html/ /data/webroot/pylib_docs/
chown www-data.www-data -R /data/webroot/pylib_docs/