diff --git a/Makefile.sphinx b/Makefile.sphinx index 4246171..c4ab795 100644 --- a/Makefile.sphinx +++ b/Makefile.sphinx @@ -1,54 +1,56 @@ # Makefile to be included by other modules, from the TOPLEVEL/docs/ dir, to # automatically build sphinx documentation. APIDOC_DIR = apidoc APIDOC_OPTS = --separate SPHINXBUILD = python3 -c 'import sphinx, sys; sys.exit(sphinx.main(sys.argv))' SPHINXAPIDOC = python3 -c 'import sphinx.apidoc, sys; sys.exit(sphinx.apidoc.main(sys.argv))' SPHINX_OPTS = SPHINX_BUILDDIR = _build SPHINX_SRCDIR = . # relative to docs/ dir. Hence "." exclude the docs/ dir itself APIDOC_EXCLUDES = APIDOC_EXCLUDES += . ../setup.py APIDOC_EXCLUDES += ../swh/*/tests ../swh/*/tests/* ../swh/*/*/tests/* ../swh/*/*/*/tests/* APIDOC_EXCLUDES += ../swh/*/migrations ../swh/*/migrations/* ../swh/*/*/migrations/* ../swh/*/*/*/migrations/* APIDOC_EXCLUDES += ../bin/* APIDOC_EXCLUDES += ../utils/* APIDOC_EXCLUDES += ../node_modules/* html: sphinx/html help: sphinx/help # allow to skip apidoc generation, for modules where the overall documentation # structure, table of contents, etc., is manually curated ifeq ($(SKIP_APIDOC),yes) apidoc_dep = else apidoc_dep = apidoc-stamp endif sphinx/clean: $(SPHINXBUILD) -M clean $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR) $(SPHINXOPTS) sphinx/%: $(apidoc_dep) $(SPHINXBUILD) -b $* $(SPHINX_SRCDIR) $(SPHINX_BUILDDIR)/$* $(SPHINXOPTS) apidoc: $(apidoc_dep) apidoc-stamp: $(SPHINXAPIDOC) $(APIDOC_OPTS) -o $(APIDOC_DIR) .. $(APIDOC_EXCLUDES) # to silent Sphinx warnings about apidoc documents not included in any toctree find $(shell pwd)/apidoc -name "*.rst" | xargs sed -i '1i:orphan:\n' touch $@ +assets: + .PHONY: clean clean-apidoc clean: sphinx/clean clean-apidoc clean-apidoc: rm -rf $(APIDOC_DIR) rm -f *-stamp # Local Variables: # mode: makefile # End: diff --git a/docs/Makefile b/docs/Makefile index 5a1770d..fcef115 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,63 +1,63 @@ SPHINXOPTS = SPHINXBUILD = python3 -c 'import sphinx, sys; sys.exit(sphinx.main(sys.argv))' SOURCEDIR = . BUILDDIR = _build HTMLDIR = $(BUILDDIR)/html INSTALL_HOST = pergamon.internal.softwareheritage.org INSTALL_DIR = /srv/softwareheritage/docs/webroot/devel INSTALL_GROUP = swhdev INSTALL_PERMS = g+rwX html: fix-indices-stamp sphinx/html fix-indices-stamp: sphinx/html bin/copy-and-fix-subprojects-indices touch $@ sphinx/html: links-stamp apidoc-stamp images-stamp rec-build-stamp links-stamp: bin/ln-sphinx-subprojects touch $@ apidoc-stamp: $(MAKE) -C ../../ docs-apidoc touch $@ images-stamp: $(MAKE) -C images touch $@ # Build documentation recursively in all packages, to make sure that auxiliary, # non-sphinx managed documentation artifacts (e.g., schema diagrams) are also # built. rec-build-stamp: $(wildcard ../../swh-*/docs/*.rst) - $(MAKE) -C ../../ docs + $(MAKE) -C ../../ docs-assets touch $@ clean: sphinx/clean bin/ln-sphinx-subprojects --remove $(MAKE) -C images clean rm -f *-stamp distclean: clean make -C ../../ docs-clean help: sphinx/help sphinx/clean: @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) sphinx/%: @$(SPHINXBUILD) -b $* "$(SOURCEDIR)" "$(BUILDDIR)/$*" $(SPHINXOPTS) install: html test -d $(HTMLDIR) rsync -rlvuz --delete $(BUILDDIR)/html/ $(INSTALL_HOST):$(INSTALL_DIR)/ ssh $(INSTALL_HOST) \ "find $(INSTALL_DIR) -not -group $(INSTALL_GROUP) -exec chgrp -v $(INSTALL_GROUP) {} + ; \ find $(INSTALL_DIR) -not -perm -ug=rw,o=r -exec chmod -v ug+rw,o+r {} + ; \ find $(INSTALL_DIR) -type d -not -perm -g=xs,ou=x -exec chmod -v g+xs,ou+x {} +" .PHONY: help html clean distclean install