kujiulabs/Makefile

47 lines
1.6 KiB
Makefile
Raw Normal View History

# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
2023-08-18 16:36:07 +02:00
SPHINXINTL = sphinx-intl
SPHINXPROJ = Contesetlgendesvol1
SOURCEDIR = source
BUILDDIR = build
2023-08-18 16:36:07 +02:00
DISTDIR = dist
SOURCELANG = fr
OTHERLANGS = en
ALLLANGS = $(SOURCELANG) $(OTHERLANGS)
BASEURL = "kujiu.eu"
2023-08-18 16:36:07 +02:00
all: translation htmlall geminiall
2023-08-18 16:36:07 +02:00
clean:
rm -rf "$(BUILDDIR)"
2023-08-18 16:36:07 +02:00
translation:
$(SPHINXBUILD) --color -d "$(BUILDDIR)/doctrees" -b gettext $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/gettext"; \
for lang in $(OTHERLANGS); \
do \
$(SPHINXINTL) update -p "$(BUILDDIR)/gettext" -l $$lang; \
done
htmlall:
mkdir -p "$(BUILDDIR)/html"; \
for lang in $(ALLLANGS); \
do \
mkdir -p "$(DISTDIR)/html/$$lang"; \
$(SPHINXBUILD) -d "$(BUILDDIR)/doctrees" --color -b html -D language='$$lang' -D html_baseurl="https://$(BASEURL)/$$lang/" -D blog_baseurl="https://$(BASEURL)/$$lang/" $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html/$$lang"; \
rsync -av --delete "$(BUILDDIR)/html/$$lang/" "$(DISTDIR)/html/$$lang"; \
done
geminiall:
mkdir -p "$(BUILDDIR)/gemini"; \
for lang in $(ALLLANGS); \
do \
mkdir -p "$(DISTDIR)/gemini/$$lang"; \
$(SPHINXBUILD) --color -d "$(BUILDDIR)/doctrees" -b gemini -D language='$$lang' -D blog_baseurl="gemini://$(BASEURL)/$$lang/" -D gemini_baseurl="gemini://$(BASEURL)/$$lang/" $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/gemini/$$lang"; \
rsync -av --delete "$(BUILDDIR)/gemini/$$lang/" "$(DISTDIR)/gemini/$$lang"; \
done
cp index.gmi $(DISTDIR)/gemini/index.gmi