# Makefile # Jeff Moe with Parrot and Phind-CodeLlama-34B-v2_q8.gguf SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = docs/source BUILDDIR = docs/build AUTOBUILDOPTS = --host 127.0.0.1 --port 8000 --ignore "*.swp" --ignore "*.swx" GETTEXT_BUILD = gettext_build UPDATE_LOCALE = sphinx-intl update -p $(BUILDDIR)/locale/gettext -d $(SOURCEDIR)/locale -l PO_FILES = $(wildcard docs/source/locale/*/LC_MESSAGES/*.po) MSGATTRIB = msgattrib LANGUAGES = am ar bn de el en eo es eu fil fr he hi id it ja ko lkt mr ms nl pl pt ru ta te th tr ur vi zh .PHONY: check help html livehtml clean_sphinx clean gettext_build update_locale build_html all copy clean_po latex pdf help: @echo "Please use \`make ' where is one of" @echo " clean Remove all build files and directories (including translations)" @echo " all Clean and make all targets" @echo " html Build the HTML documentation for all languages" @echo " latex Build the documentation using LaTeX" @echo " pdf Build the PDFS documentation using LaTeX" @echo " html_ Build HTML documentation for " @echo " update_locale Update localisation" @echo " update_locale_ Update localisation for " @echo " gettext_build Build localisation strings for translation" @echo " index Copy static docs/index.html to docs/build/html/index.html" all: clean gettext_build update_locale html index check: @for po in $(PO_FILES); do \ echo "Checking $$po..."; \ msgfmt --check --output-file=- "$$po" || exit 1; \ done index: cp -p docs/index.html docs/build/html/index.html clean: for file in $(PO_FILES); do \ $(MSGATTRIB) --no-obsolete -o $$file $$file; \ done cd docs && make clean find $(SOURCEDIR) -type f -name "*.mo" -delete rm -rf $(BUILDDIR)/* gettext_build: $(SPHINXBUILD) -b gettext -c $(SOURCEDIR) -d $(BUILDDIR)/doctrees/$(GETTEXT_BUILD) $(SOURCEDIR) $(BUILDDIR)/locale/gettext update_locale: @pids="" ; \ for lang in $(LANGUAGES); do \ ( echo "Updating locale for $$lang..." ; $(UPDATE_LOCALE) $$lang ) & pids="$$pids $$!" ; \ done ; \ for pid in $$pids; do \ wait $$pid ; \ done update_locale_%: $(UPDATE_LOCALE) $* html: @for lang in $(LANGUAGES); do \ echo "Building HTML documentation for $$lang..."; \ $(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=$$lang $(SOURCEDIR) $(BUILDDIR)/html/$$lang; \ done latex: $(SPHINXBUILD) -b latex -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/latex pdf: cd docs/build/latex/ ; make html_%: gettext_build $(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=$* -c $(SOURCEDIR) $(SOURCEDIR) $(BUILDDIR)/html/$*/