parrot-wtf/Makefile

87 lines
3.3 KiB
Makefile

# 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_AR = sphinx-intl update -p $(BUILDDIR)/locale/gettext -d $(SOURCEDIR)/locale -l ar
UPDATE_LOCALE_EN = sphinx-intl update -p $(BUILDDIR)/locale/gettext -d $(SOURCEDIR)/locale -l en
UPDATE_LOCALE_ES = sphinx-intl update -p $(BUILDDIR)/locale/gettext -d $(SOURCEDIR)/locale -l es
UPDATE_LOCALE_ZH = sphinx-intl update -p $(BUILDDIR)/locale/gettext -d $(SOURCEDIR)/locale -l zh
PO_FILES = $(wildcard docs/source/locale/*/LC_MESSAGES/*.po)
MSGATTRIB = msgattrib
.PHONY: help html livehtml clean_sphinx clean gettext_build update_locale_en update_locale_es update_locale_zh build_html_en build_html_es build_html_zh all copy clean_po
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " livehtml to serve the documentation with live reloading"
@echo " clean_sphinx to remove all built files in docs/"
@echo " clean to remove all build files and directories (including translations)"
@echo " gettext_build to build localisation strings for translation"
@echo " update_locale_ar to update Arabic localisation"
@echo " update_locale_en to update English localisation"
@echo " update_locale_es to update Spanish localisation"
@echo " update_locale_zh to update Simplified Chinese localisation"
@echo " build_html_ar to build the HTML documentation for Arabic"
@echo " build_html_en to build the HTML documentation for English"
@echo " build_html_es to build the HTML documentation for Spanish"
@echo " build_html_zh to build the HTML documentation for Simplified Chinese"
@echo " all to clean and make all targets"
@echo " copy to copy docs/index.html to docs/build/html/index.html"
@echo " clean_po to clean gettext files in .po format"
all: clean_sphinx build_html_ar build_html_en build_html_es build_html_zh gettext_build update_locale_en update_locale_es update_locale_zh copy
copy:
cp docs/index.html docs/build/html/index.html
clean_po:
for file in $(PO_FILES); do \
$(MSGATTRIB) --no-obsolete -o $$file $$file; \
done
html:
cd docs && make $(SPHINXOPTS) html
livehtml:
sphinx-autobuild $(AUTOBUILDOPTS) $(SOURCEDIR) $(BUILDDIR)/html
clean_sphinx:
cd docs && make clean
clean: clean_po clean_sphinx
rm -rf $(BUILDDIR)/*
gettext_build:
$(SPHINXBUILD) -b gettext -c $(SOURCEDIR) -d $(BUILDDIR)/doctrees/$(GETTEXT_BUILD) $(SOURCEDIR) $(BUILDDIR)/locale/gettext
update_locale_ar:
$(UPDATE_LOCALE_AR)
update_locale_en:
$(UPDATE_LOCALE_EN)
update_locale_es:
$(UPDATE_LOCALE_ES)
update_locale_zh:
$(UPDATE_LOCALE_ZH)
build_html_ar:
$(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=ar $(SOURCEDIR) $(BUILDDIR)/html/ar
build_html_en:
$(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=en $(SOURCEDIR) $(BUILDDIR)/html/en
build_html_es:
$(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=es $(SOURCEDIR) $(BUILDDIR)/html/es
build_html_zh:
$(SPHINXBUILD) -b html -d $(BUILDDIR)/doctrees -D language=zh $(SOURCEDIR) $(BUILDDIR)/html/zh