Refactoring of docs/Makefile

This commit is contained in:
Griatch 2020-04-05 13:19:32 +02:00
parent fd8ee949a8
commit ddd3e2234c

View file

@ -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."