Changeset View
Changeset View
Standalone View
Standalone View
Makefile.sphinx
Show All 25 Lines | |||||
# structure, table of contents, etc., is manually curated | # structure, table of contents, etc., is manually curated | ||||
ifeq ($(SKIP_APIDOC),yes) | ifeq ($(SKIP_APIDOC),yes) | ||||
apidoc_dep = | apidoc_dep = | ||||
else | else | ||||
apidoc_dep = apidoc-stamp | apidoc_dep = apidoc-stamp | ||||
endif | endif | ||||
sphinx/clean: | sphinx/clean: | ||||
if [ -f "$(CURDIR)/images/Makefile" ]; then \ | |||||
make -C $(CURDIR)/images/ clean; \ | |||||
fi | |||||
$(SPHINXBUILD) -M clean $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR) $(SPHINXOPTS) | $(SPHINXBUILD) -M clean $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR) $(SPHINXOPTS) | ||||
sphinx/%: $(apidoc_dep) | sphinx/%: $(apidoc_dep) | ||||
if [ -f "$(CURDIR)/images/Makefile" ]; then \ | |||||
make -C $(CURDIR)/images/ $@; \ | |||||
fi | |||||
$(SPHINXBUILD) -b $* $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR)/$* $(SPHINXOPTS) | $(SPHINXBUILD) -b $* $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR)/$* $(SPHINXOPTS) | ||||
apidoc: $(apidoc_dep) | apidoc: $(apidoc_dep) | ||||
apidoc-stamp: | apidoc-stamp: | ||||
$(SPHINXAPIDOC) $(APIDOC_OPTS) -o $(APIDOC_DIR) .. $(APIDOC_EXCLUDES) | $(SPHINXAPIDOC) $(APIDOC_OPTS) -o $(APIDOC_DIR) .. $(APIDOC_EXCLUDES) | ||||
# to silent Sphinx warnings about apidoc documents not included in any toctree | # to silent Sphinx warnings about apidoc documents not included in any toctree | ||||
find $(shell pwd)/apidoc -name "*.rst" | xargs sed -i '1i:orphan:\n' | find $(shell pwd)/apidoc -name "*.rst" | xargs sed -i '1i:orphan:\n' | ||||
touch $@ | touch $@ | ||||
.PHONY: clean clean-apidoc | .PHONY: clean clean-apidoc sphinx/clean | ||||
clean: sphinx/clean clean-apidoc | clean: sphinx/clean clean-apidoc | ||||
clean-apidoc: | clean-apidoc: | ||||
rm -rf $(APIDOC_DIR) | rm -rf $(APIDOC_DIR) | ||||
rm -f *-stamp | rm -f *-stamp | ||||
# Local Variables: | # Local Variables: | ||||
# mode: makefile | # mode: makefile | ||||
# End: | # End: |