From 886307ec48e354e45d56298acc7035ad849d01b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Bela=C3=AFche?= Date: Sun, 31 Dec 2023 17:37:09 +0100 Subject: [PATCH] Generate manual for other languages than default. * doc/translations/fr/info_common.mk: * doc/translations/default/info_common.mk: New file. * doc/misc/Makefile.in: Get INFO_COMMON from language respective info_common.mk helper script. (INFO_TARGETS): Make it depend from info_common.mk settings. (ORG_SETUP, ORG_SRC): Make it point at language specific sub-directory. (texi_sources, DVI_TARGETS, HTML_TARGETS, PDF_TARGETS) (PS_TARGETS, echo-info, info_template,efaq%$(lang_suffix).dvi) (efaq%$(lang_suffix).pdf, efaq%$(lang_suffix).texi) (efaq%$(lang_suffix).html): Make it use language specific suffix. (${buildinfodir}/%$(lang_suffix).info, %$(lang_suffix).dvi) (%$(lang_suffix).pdf, %$(lang_suffix).html, %$(lang_suffix).ps): Make it use language specific suffix/subdirectory. * Makefile.in (DOCLANGS): New variable, list of languages. (install-info, uninstall): List targets into 'info_misc' for all languages. (TAGS tags): Make tags for all languages. ($(DOCS)): Create target for all languages. (texi_misc_fr, texi_misc_default): Set macro for all languages. (srcdir_doc_info_dir_inputs): Macro concatenate texi_misc_lll for all language lll. --- Makefile.in | 26 +++++++--- doc/misc/Makefile.in | 64 ++++++++++++++----------- doc/translations/default/info_common.mk | 9 ++++ doc/translations/fr/info_common.mk | 8 ++++ 4 files changed, 72 insertions(+), 35 deletions(-) create mode 100644 doc/translations/default/info_common.mk create mode 100644 doc/translations/fr/info_common.mk diff --git a/Makefile.in b/Makefile.in index ea05fe6ac99..bc3b6c7b3e3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -115,6 +115,9 @@ HAVE_GSETTINGS = @HAVE_GSETTINGS@ ANDROID = @ANDROID@ +# TODO : make a configure option to keep only desired languages +DOCLANGS?=default fr + # ==================== Where To Install Things ==================== # Location to install Emacs.app under GNUstep / macOS. @@ -794,7 +797,7 @@ install-info: info [ -f "$(DESTDIR)${infodir}/dir" ] || \ [ ! -f ${srcdir}/info/dir ] || \ ${INSTALL_DATA} ${srcdir}/info/dir "$(DESTDIR)${infodir}/dir"; \ - info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \ + info_misc="$(foreach lang,$(DOCLANGS),`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc LANG=$(lang) echo-info`)"; \ cd ${srcdir}/info ; \ for elt in ${INFO_NONMISC} $${info_misc}; do \ for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \ @@ -944,7 +947,7 @@ uninstall: uninstall-$(NTDIR) uninstall-doc uninstall-gsettings-schemas done -rm -rf "$(DESTDIR)${libexecdir}/emacs/${version}" thisdir=`pwd -P`; \ - (info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \ + (info_misc="$(foreach lang,$(DOCLANGS),`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc LANG=$(lang) echo-info`)"; \ if cd "$(DESTDIR)${infodir}"; then \ for elt in ${INFO_NONMISC} $${info_misc}; do \ (cd "$${thisdir}"; \ @@ -1122,7 +1125,7 @@ TAGS tags: lib lib-src # src $(MAKE) -C doc/emacs tags $(MAKE) -C doc/lispintro tags $(MAKE) -C doc/lispref tags - $(MAKE) -C doc/misc tags + $(foreach LANG,$(DOCLANGS),$(MAKE) -C doc/misc LANG=$(LANG) tags;) CHECK_TARGETS = check check-maybe check-expensive check-all check-byte-compile .PHONY: $(CHECK_TARGETS) @@ -1143,8 +1146,12 @@ PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf PSS = lispref-ps lispintro-ps emacs-ps misc-ps DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS) -$(DOCS): - $(MAKE) -C doc/$(subst -, ,$@) +define MAKE_DOC +$(1): + $(foreach lang,$(DOCLANGS),$$(MAKE) -C doc/$$(subst -, LANG=$(lang) ,$$@);) + +endef +$(foreach doc,$(DOCS),$(eval $(call MAKE_DOC,$(doc)))) .PHONY: $(DOCS) docs pdf ps .PHONY: info dvi dist html info-dir check-info @@ -1168,13 +1175,18 @@ misc-dvi misc-html misc-pdf misc-ps: src info-dir: ${srcdir}/info/dir -texi_misc = $(shell MAKEFLAGS= ${MAKE} --no-print-directory -s -C doc/misc echo-sources) +define set_texi_misc +texi_misc_$(1) = $$(shell MAKEFLAGS= $${MAKE} --no-print-directory -s -C doc/misc LANG=$(1) echo-sources) + +endef + +$(foreach lang,$(DOCLANGS),$(eval $(call set_texi_misc,$(lang)))) srcdir_doc_info_dir_inputs = \ ${srcdir}/doc/emacs/emacs.texi \ ${srcdir}/doc/lispintro/emacs-lisp-intro.texi \ ${srcdir}/doc/lispref/elisp.texi \ - $(addprefix ${srcdir}/doc/misc/,${texi_misc}) + $(foreach lang,$(DOCLANGS),$(addprefix ${srcdir}/doc/misc/$(filter-out ../translations/default/misc/,../translations/$(lang)/misc/),$(texi_misc_$(lang)) )) info_dir_inputs = \ ../build-aux/dir_top \ $(subst ${srcdir}/doc/,,${srcdir_doc_info_dir_inputs}) diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index 95c8a92ded1..46b92c8ea8e 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -63,18 +63,20 @@ INSTALL_DATA = @INSTALL_DATA@ MAKEINFO = @MAKEINFO@ MAKEINFO_OPTS = --force -I$(emacsdir) +ifeq ($(LANG),) +LANG:=default +else ifeq ($(wildcard ../translations/$(LANG)/info_common.mk),) +LANG:=default +endif + +lang_suffix:=$(filter-out -default,-$(LANG)) +lang_subdir:=$(filter-out ../translations/default/misc/,../translations/$(LANG)/misc/) + ## On MS Windows, efaq-w32; otherwise blank. DOCMISC_W32 = @DOCMISC_W32@ ## Info files to build and install on all platforms. -INFO_COMMON = auth autotype bovine calc ccmode cl dbus dired-x \ - ebrowse ede ediff edt efaq eglot eieio emacs-gnutls \ - emacs-mime epa erc ert eshell eudc eww flymake forms gnus \ - htmlfontify idlwave ido info.info mairix-el message mh-e \ - modus-themes newsticker nxml-mode octave-mode org pcl-cvs pgg \ - rcirc reftex remember sasl sc semantic ses sieve smtpmail \ - speedbar srecode todo-mode tramp transient url use-package \ - vhdl-mode viper vtable widget wisent woman +include ../translations/$(LANG)/info_common.mk ## Info files to install on current platform. INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32) @@ -82,13 +84,13 @@ INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32) ## Info files to build on current platform. ## This is all of them, even though they might not all get installed, ## because the info files are pre-built in release tarfiles. -INFO_TARGETS = $(INFO_COMMON) efaq-w32 +INFO_TARGETS = $(INFO_COMMON) $(DOCMISC_W32_TARGET) ## Some manuals have their source in .org format. ## This is discouraged because the .texi files it generates ## are not as well formatted as handwritten ones. -ORG_SETUP = $(wildcard ${srcdir}/*-setup.org) -ORG_SRC = $(filter-out ${ORG_SETUP},$(wildcard ${srcdir}/*.org)) +ORG_SETUP = $(wildcard ${srcdir}/$(lang_subdir)*-setup.org) +ORG_SRC = $(filter-out ${ORG_SETUP},$(wildcard ${srcdir}/$(lang_subdir)*.org)) TEXI_FROM_ORG = ${ORG_SRC:.org=.texi} # There are some naming differences between the info targets and the other @@ -96,15 +98,18 @@ TEXI_FROM_ORG = ${ORG_SRC:.org=.texi} TARGETS_1 = $(INFO_INSTALL:ccmode=cc-mode) TARGETS = $(TARGETS_1:info.info=info) -texi_sources = $(addsuffix .texi,${TARGETS}) +# Sources are also suffixed, this is useless as they are in different +# directories, but some people argued that there should not be +# different files with same name in the repo. +texi_sources = $(addsuffix $(lang_suffix).texi,${TARGETS}) texi_notgen = $(filter-out $(notdir ${TEXI_FROM_ORG}),${texi_sources}) texi_and_org = $(notdir ${ORG_SRC}) ${texi_notgen} SOURCES = $(sort ${texi_and_org}) -DVI_TARGETS = $(TARGETS:=.dvi) -HTML_TARGETS = $(TARGETS:=.html) -PDF_TARGETS = $(TARGETS:=.pdf) -PS_TARGETS = $(TARGETS:=.ps) +DVI_TARGETS = $(TARGETS:=$(lang_suffix).dvi) +HTML_TARGETS = $(TARGETS:=$(lang_suffix).html) +PDF_TARGETS = $(TARGETS:=$(lang_suffix).pdf) +PS_TARGETS = $(TARGETS:=$(lang_suffix).ps) TEXI2DVI = texi2dvi TEXI2PDF = texi2pdf @@ -132,7 +137,7 @@ info: $(INFO_TARGETS) ## Base file names of output info files. INFO_BASES = $(patsubst %.info,%,$(notdir $(INFO_INSTALL))) echo-info: - @: $(info $(addsuffix .info,$(INFO_BASES))) + @: $(info $(addsuffix $(lang_suffix).info,$(INFO_BASES))) echo-sources: @: $(info $(SOURCES)) @@ -152,13 +157,13 @@ ${buildinfodir}: EXTRA_OPTS = -${buildinfodir}/%.info: ${srcdir}/%.texi ${gfdl} ${style} | ${buildinfodir} +${buildinfodir}/%$(lang_suffix).info: ${srcdir}/$(lang_subdir)%$(lang_suffix).texi ${gfdl} ${style} | ${buildinfodir} $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) $(EXTRA_OPTS) \ -o $@ $< ## The short aliases, eg efaq = $(buildinfodir)/efaq.info. define info_template - $(1): $$(buildinfodir)/$(1).info + $(1): $$(buildinfodir)/$(1)$(lang_suffix).info endef ## "info" is already taken. @@ -167,17 +172,17 @@ info.info: $(buildinfodir)/info.info $(foreach ifile,$(filter-out info.info,$(INFO_TARGETS)),$(eval $(call info_template,$(ifile)))) -%.dvi: ${srcdir}/%.texi ${gfdl} ${style} +%$(lang_suffix).dvi: ${srcdir}/$(lang_subdir)%$(lang_suffix).texi ${gfdl} ${style} $(ENVADD) $(TEXI2DVI) $< -%.pdf: ${srcdir}/%.texi ${gfdl} ${style} +%$(lang_suffix).pdf: ${srcdir}/$(lang_subdir)%$(lang_suffix).texi ${gfdl} ${style} $(ENVADD) $(TEXI2PDF) $< -%.html: ${srcdir}/%.texi ${gfdl} ${style} +%$(lang_suffix).html: ${srcdir}/$(lang_subdir)%$(lang_suffix).texi ${gfdl} ${style} $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) $(EXTRA_OPTS) \ -o $@ $< -%.ps: %.dvi +%$(lang_suffix).ps: %$(lang_suffix).dvi $(DVIPS) -o $@ $< @@ -204,16 +209,16 @@ ${buildinfodir}/ccmode.info: \ ## efaq, efaq_w32 do not depend on gfdl. ## Maybe we can use .SECONDEXPANSION for this. -${buildinfodir}/efaq%.info: ${srcdir}/efaq%.texi ${style} | ${buildinfodir} +${buildinfodir}/efaq%$(lang_suffix).info: ${srcdir}/efaq%$(lang_suffix).texi ${style} | ${buildinfodir} $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $< -efaq%.dvi: ${srcdir}/efaq%.texi +efaq%$(lang_suffix).dvi: ${srcdir}/efaq%$(lang_suffix).texi $(ENVADD) $(TEXI2DVI) $< -efaq%.pdf: ${srcdir}/efaq%.texi +efaq%$(lang_suffix).pdf: ${srcdir}/efaq%$(lang_suffix).texi $(ENVADD) $(TEXI2PDF) $< -efaq%.html: ${srcdir}/efaq%.texi +efaq%$(lang_suffix).html: ${srcdir}/efaq%$(lang_suffix).texi $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $< ${buildinfodir}/emacs-mime.info emacs-mime.html: EXTRA_OPTS = --enable-encoding @@ -248,7 +253,10 @@ emacs = "${EMACS}" -batch --no-site-file --no-site-lisp --eval '(setq load-prefe # things like org-setup's "version" macro work. Sigh. define org_template $(1:.org=.texi): $(1) ${top_srcdir}/lisp/org/ox-texinfo.el - $${AM_V_GEN}cd "$${srcdir}" && $${emacs} -l ox-texinfo \ + $${AM_V_GEN}cd "$${srcdir}" && $${emacs} \ + --eval '(add-to-list (quote load-path) "$(abspath ${top_srcdir}/lisp/org)")' \ + --eval '(setq org--inhibit-version-check t)' \ + -l ox-texinfo \ --eval '(setq gc-cons-threshold 50000000)' \ --eval '(setq org-confirm-babel-evaluate nil)' \ --eval '(setq org-id-track-globally nil)' \ diff --git a/doc/translations/default/info_common.mk b/doc/translations/default/info_common.mk new file mode 100644 index 00000000000..9c09f5a0cec --- /dev/null +++ b/doc/translations/default/info_common.mk @@ -0,0 +1,9 @@ +## Info files to build and install on all platforms. +INFO_COMMON = auth autotype bovine calc ccmode cl dbus dired-x \ + ebrowse ede ediff edt efaq eglot eieio emacs-gnutls \ + emacs-mime epa erc ert eshell eudc eww flymake forms gnus \ + htmlfontify idlwave ido info.info mairix-el message mh-e \ + modus-themes newsticker nxml-mode octave-mode org pcl-cvs pgg \ + rcirc reftex remember sasl sc semantic ses sieve smtpmail \ + speedbar srecode todo-mode tramp transient url use-package \ + vhdl-mode viper vtable widget wisent woman diff --git a/doc/translations/fr/info_common.mk b/doc/translations/fr/info_common.mk new file mode 100644 index 00000000000..e72440fe69a --- /dev/null +++ b/doc/translations/fr/info_common.mk @@ -0,0 +1,8 @@ +## Info files to build and install on all platforms (onl ses has been +## translated to Frenchj) +INFO_COMMON = ses + +## efac-w32 has not been translated to French +DOCMISC_W32:=# + +DOCMISC_W32_TARGET:=#