From ddd3e2234c320144d28226f7b8e605e3d51558d8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 5 Apr 2020 13:19:32 +0200 Subject: [PATCH] Refactoring of docs/Makefile --- docs/Makefile | 70 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index b8f73510bf..dc39734d39 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,7 +17,11 @@ EVGAMEDIR ?= $(realpath ../../gamedir) help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @echo "Evennia-specific: " - @echo " release - build and prepare multiversion docs and auto-docs for release." + @echo " install - get build requirements" + @echo " clean - remove remnants of a previous build" + @echo " local - build local html docs of the current branch (no multiversion)." + @echo " mv-local - build full multiversion html docs, without deploying (req. all changes committed to git)" + @echo " release - build and deploy multiversion docs online (req. github push access)" .PHONY: help Makefile @@ -28,47 +32,55 @@ help: # Evennia - custom commands +# helper targets + +_check-env: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh + +_multiversion-check-env: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh multiversion + +_autodoc-index: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR) + +_multiversion-autodoc-index: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR) + git diff-index --quiet HEAD || git commit -a -m "Updated API autodoc index." + +_build: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html" + +_multiversion-build: + @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html" + +_multiversion-deploy: + @bash -e deploy.sh + +# main targets + install: @pip install -r requirements.txt -# build / update only the api-autodoc index -autodoc-index: - @sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR) - -api-build: - @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html/api" - clean: @rm -Rf $(BUILDDIR) @git clean -f -d docs/ @echo "Cleaned old build dir and leftover files." - -# multiversion release builds - -mv-check-env: - @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh multiversion - -# we must commit the index before it's made available to multiversion -mv-autodoc-index: - @sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR) - git diff-index --quiet HEAD || git commit -a -m "Updated API autodoc index." - -multiversion-build: - @EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html" - -mv-deploy: - @bash -e deploy.sh +local: + make _check-env + make clean + make _autodoc_index + make _build mv-local: - make mv-check-env + make _multiversion-check-env make clean - make mv-autodoc-index - make multiversion-build + make _multiversion-autodoc-index + make _multiversion-build # build and prepare the docs for release -mv-release: +release: make mv-local - # make mv-deploy + # make _mv-deploy @echo "" @echo "Deployment complete."