evennia/docs/Makefile

75 lines
1.9 KiB
Makefile
Raw Normal View History

2020-04-05 00:02:02 +02:00
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
2020-04-05 13:00:01 +02:00
AUTODOCDIR = $(SOURCEDIR)/api
2020-04-05 00:02:02 +02:00
2020-04-05 11:37:35 +02:00
EVDIR ?= $(realpath ../evennia)
2020-04-05 00:02:02 +02:00
EVGAMEDIR ?= $(realpath ../../gamedir)
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo "Evennia-specific: "
@echo " release - build and prepare multiversion docs and auto-docs for release."
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
2020-04-05 13:00:01 +02:00
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2020-04-05 00:02:02 +02:00
# Evennia - custom commands
install:
@pip install -r requirements.txt
2020-04-05 13:00:01 +02:00
# build / update only the api-autodoc index
2020-04-05 00:02:02 +02:00
autodoc-index:
@sphinx-apidoc -f -o $(SOURCEDIR)/api/ $(EVDIR)
api-build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/html/api"
clean:
@rm -Rf $(BUILDDIR)
2020-04-05 13:00:01 +02:00
@git clean -f -d docs/
2020-04-05 00:02:02 +02:00
@echo "Cleaned old build dir and leftover files."
2020-04-05 13:00:01 +02:00
# 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)
2020-04-05 13:02:15 +02:00
git diff-index --quiet HEAD || git commit -a -m "Updated API autodoc index."
2020-04-05 13:00:01 +02:00
multiversion-build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html"
mv-deploy:
2020-04-05 00:02:02 +02:00
@bash -e deploy.sh
2020-04-05 13:00:01 +02:00
mv-local:
make mv-check-env
2020-04-05 00:02:02 +02:00
make clean
2020-04-05 13:00:01 +02:00
make mv-autodoc-index
2020-04-05 00:02:02 +02:00
make multiversion-build
2020-04-05 13:00:01 +02:00
# build and prepare the docs for release
mv-release:
make mv-local
# make mv-deploy
2020-04-05 00:02:02 +02:00
@echo ""
@echo "Deployment complete."