From 5e10c0b6a02e4382057ac7bd0f3924cf61f54775 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 25 Mar 2022 16:22:55 +0100 Subject: build languages in their subdir & add version by separating builders commands from the other, we can directly choose the output dir --- Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c42af71..8f8e08e 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # Minimal makefile for Sphinx documentation # # You can set these variables from the command line. -override LOCALE := $(or $(LOCALE),fr) +LOCALE ?= fr PUBHOST ?= club1.fr -PUBDIR ?= /var/www/docs/$(LOCALE) +PUBDIR ?= /var/www/docs ifneq "$(LOCALE)" "fr" override NOTFR = 1 @@ -14,7 +14,7 @@ endif SPHINXLANG = -D language=$(LOCALE) SPHINXOPTS += -a SPHINXBUILD ?= sphinx-build -SPHINXLCMDS = html dirhtml singlehtml epub latex latexpdf latexpdfja text man texinfo info +SPHINXBUILDERS = html dirhtml singlehtml epub latex text man texinfo SPHINXCMDS = pickle json htmlhelp changes xml pseudoxml linkcheck doctest coverage SOURCEDIR = . BUILDDIR = _build @@ -27,7 +27,7 @@ DIRS = locales help: $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $O -.PHONY: help clean update-po gettext publish $(SPHINXLCMDS) $(SPHINXCMDS) +.PHONY: help clean update-po gettext latexpdf info publish $(SPHINXBUILDERS) $(SPHINXCMDS) update-po: $(LOCALEFILES) @@ -47,12 +47,18 @@ $(BUILDDIR)/gettext/package.pot: $(MDFILES) $(SPHINXBUILD) -M gettext "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $O @touch $@ +latexpdf: latex + $(MAKE) -C $(BUILDDIR)/latex/$(LOCALE) + +info: texinfo + $(MAKE) -C $(BUILDDIR)/texinfo/$(LOCALE) + publish: html rsync -av --del _build/html/ $(USER)@$(PUBHOST):$(PUBDIR) -# Shinx commands that need locales. -$(SPHINXLCMDS): $(if $(NOTFR),locales/$(LOCALE)/LC_MESSAGES/package.po) - $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXLANG) $(SPHINXOPTS) $O +# Shinx commands that need locales (builders). +$(SPHINXBUILDERS): $(if $(NOTFR),locales/$(LOCALE)/LC_MESSAGES/package.po) + $(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)/$@/$(LOCALE)" $(SPHINXLANG) $(SPHINXOPTS) $O # Other Sphinx commands for autocompletion $(SPHINXCMDS): -- cgit v1.2.3