From 1aeae3e685706e19df5cf9084e71685db8e18d1a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 9 Aug 2017 22:15:00 +0000 Subject: latex2e-help-texinfo-fr (9aug17) git-svn-id: svn://tug.org/texlive/trunk@44997 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/latex2e-help-texinfo-fr/Makefile | 173 ++++++++++++++++++--- 1 file changed, 149 insertions(+), 24 deletions(-) (limited to 'Master/texmf-dist/doc/latex/latex2e-help-texinfo-fr/Makefile') diff --git a/Master/texmf-dist/doc/latex/latex2e-help-texinfo-fr/Makefile b/Master/texmf-dist/doc/latex/latex2e-help-texinfo-fr/Makefile index eaa9ec00a06..22181fd3d11 100644 --- a/Master/texmf-dist/doc/latex/latex2e-help-texinfo-fr/Makefile +++ b/Master/texmf-dist/doc/latex/latex2e-help-texinfo-fr/Makefile @@ -21,6 +21,7 @@ xref_suffixes := $(xref_suffixes) $(addsuffix s,$(xref_suffixes)) xref_suffixes := aux log toc $(xref_suffixes) tex_suffixes = dvi pdf makeinfo_suffixes = dbk html info txt xml +suffixes=$(tex_suffixes) $(makeinfo_suffixes) en_longname:=english es_longname:=spanish fr_longname:=french @@ -38,6 +39,7 @@ $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) # all_suffixes = dvi pdf $(makeinfo_suffixes) +all_manuals:=$(foreach lang,$(languages),$($(lang)_manual)) # how to build. @@ -55,24 +57,24 @@ texi2xml = $(makeinfo) --xml # Go somewhere useful from Top. texi2html_top = -c TOP_NODE_UP_URL=http://tug.org/texinfohtml/ -%.pdf: %.texi +$(addsuffix .pdf,$(all_manuals)):%.pdf: %.texi $(texi2pdf) $< -%.dvi: %.texi +$(addsuffix .dvi,$(all_manuals)):%.dvi: %.texi $(texi2dvi) $< # -%.dbk: %.texi +$(addsuffix .dbk,$(all_manuals)):%.dbk: %.texi $(texi2docbook) -o $@ $< -%.html: %.texi +$(addsuffix .html,$(all_manuals)):%.html: %.texi $(texi2html) $< -%/index.html: %.texi +$(addsuffix /index.html,$(all_manuals)):%/index.html: %.texi $(makeinfo) --html $(texi2html_top) $< -%.info: %.texi +$(addsuffix .info,$(all_manuals)):%.info: %.texi $(texi2info) $< -%.txt: %.texi +$(addsuffix .txt,$(all_manuals)):%.txt: %.texi $(texi2txt) -o $@ $< -%.xml: %.texi +$(addsuffix .xml,$(all_manuals)):%.xml: %.texi $(texi2xml) $< @@ -88,7 +90,7 @@ check_suffixes = html info pdf check: $(addprefix check-,$(languages)) define lang_template .PHONY:check-$(1) -check-$(1): spell-$(lang) $(addprefix $($(1)_manual), $(check_suffixes)) +check-$(1): spell-$(lang) $(addprefix $($(1)_manual)., $(check_suffixes)) license-check-$(lang) endef $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) @@ -97,7 +99,7 @@ $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) # Build per language. define lang_template .PHONY: $(1) -$(1): $($(lang)_output) +$(1): license-check-$(1) $($(1)_output) endef $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) @@ -125,7 +127,19 @@ function updated(){\ endef define en_updated_awk function updated(){\ - return strftime("%B %Y",time_stamp);\ + monthes[1]="January";\ + monthes[2]="February";\ + monthes[3]="March";\ + monthes[4]="April";\ + monthes[5]="May";\ + monthes[6]="June";\ + monthes[7]="July";\ + monthes[8]="August";\ + monthes[9]="September";\ + monthes[10]="October";\ + monthes[11]="November";\ + monthes[12]="December";\ + return monthes[month] " " year;\ } endef define es_updated_awk @@ -176,14 +190,47 @@ $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) .PHONY: all all: $(languages) +# Check license consistency +define get_license_awk +BEGIN { print_enb = 0 }; \ +/^@comment end of License/ { exit(0) }; \ +print_enb == 1 { print }; \ +/^@comment start of License/ { print_enb = 1} +endef + +define lang_template +.PHONY: license-check-$(1) +license-check-$(1): license.texi $($(1)_manual).texi + awk '$(get_license_awk)' $($(1)_manual).texi > temp.texi; \ + if diff license.texi temp.texi; then rm temp.texi; else \ + echo "ERROR: License in manual $($(1)_manual).texi is inconsistent with license.texi" > /dev/stderr; \ + exit -1;\ + fi +endef +$(foreach lang,$(other_languages), $(eval $(call lang_template,$(lang)))) + +.PHONY: license-check-$(default_language) +license-check-$(default_language): license.texi + +license.texi: $($(default_language)_manual).texi + awk '$(get_license_awk)' $< > $@ + if [ `wc -l $@ | cut -d " " -f 1` -le 2 ]; then \ + rm $@; \ + echo "ERROR: Can't find license in $<" > /dev/stderr; \ + exit -1; \ + fi + + + # following the GNU sequence of clean targets. .PHONY: distclean clean mostlyclean distclean clean mostlyclean: - rm -rf $(manual)*.t2* + rm -rf $(manual)*.t2* license.texi + rm -f $(patsubst %,node-list-%.txt,$(languages)) .PHONY: realclean maintainer-clean realclean maintainer-clean: distclean - rm -f $(addprefix $(manual)*., $(tex_suffixes) $(makeinfo_suffixes) $(xref_suffixes)) + rm -f $(addprefix $(manual)*., $(suffixes) $(xref_suffixes)) rm -fr $(foreach lang,$(addprefix dist-,$(languages)),$($(lang)) $($(lang)).zip) rm -fr $(manual)-help-texinfo $(manual)-help-texinfo.zip @@ -191,25 +238,34 @@ realclean maintainer-clean: distclean # dist for CTAN. Also update NEWS # define txt_files -ChangeLog Makefile.1 license.texi $(subst -$(default_language),,NEWS-$(1) README-$(1)) ltx-help.el +ChangeLog Makefile.1 common.texi \ +$(addsuffix $(subst -$(default_language),,-$(1)),NEWS README) \ +ltx-help.el endef define dist_output $($(1)_makeinfo_output) $(addprefix $($(1)_manual).,pdf texi) aspell.$(1).pws endef +# $(1) = to be created & zipped directory name +# $(2) = en fr es +# $(3) = reverse path for $(1) +# $(4) = list of source files and other text files to be distributed. define make_dist_dir mkdir -p $(1); \ cd $(1); \ $(foreach file,$(call dist_output,$(2)) $(4), \ - ln -s $(3)/$(file) $(subst Makefile.1,Makefile,$(file));) \ + ln -s $(3)/$(file) \ + $(subst README-$(2),README,\ + $(subst Makefile.1,Makefile,\ + $(file)));) \ cd $(3); endef # Distribution per language. define lang_template .PHONY: dist-$(1) -dist-$(1): updated-$(1) +dist-$(1): $(1) updated-$(1) @uncommited=`svn status $$(call dist_output,$(1)) $$(call txt_files,$(1))`; \ echo -n "$$$$uncommited"; \ if [ -n "$$$$uncommited" -a -z "$(DIST_FORCE)" ]; \ @@ -272,22 +328,30 @@ $(foreach lang,$(languages), $(eval $(call lang_template,$(lang)))) # Check for doubled words. # http://www.math.utah.edu/~beebe/software/file-tools.html#dw -check-dw: - grep -v '^@item' $(manual).texi | dw +.PHONY: check-dw +check-dw: $(addprefix check-dw-,$(languages)) + +define _1 +.PHONY: check-dw-$(1) +check-dw-$(1): $($(1)_manual).texi + grep -v '^@item' $$< | dw + +endef +$(eval $(foreach LANG,$(languages),$(call _1,$(LANG)))) # Convenience target to tag a delivery to CTAN -GNA_USERID&=vincentb1 +VC_USERID&=vincentb1 TAG?=ctan$(VERSION) MESSAGE?=Delivery to CTAN $(VERSION) -CTANTAG?=svn copy svn+ssh://$(GNA_USERID)@svn.gna.org/svn/latexrefman/trunk svn+ssh://$(GNA_USERID)@svn.gna.org/svn/latexrefman/tags/$(TAG) -m "$(MESSAGE)" +CTANTAG?=svn copy svn+ssh://$(VC_USERID)@svn.gna.org.ua/latexrefman/trunk svn+ssh://$(VC_USERID)@svn.gna.org.ua/latexrefman/tags/$(TAG) -m "$(MESSAGE)" .PHONY: tag tag: -ifeq ($(GNA_USERID),) - echo 'Please define GNA_USERID variable in your environment to your GNA! user id' +ifeq ($(VC_USERID),) + echo 'Please define VC_USERID variable in your environment to your Puszcza user id' exit -1 else ifeq ($(TAG),ctan) - @if test -z '$(GNA_USERID)'; then \ - echo 'Please define GNA_USERID variable in your environment to your GNA! user id'; \ + @if test -z '$(VC_USERID)'; then \ + echo 'Please define VC_USERID variable in your environment to your Puszcza user id'; \ exit -1; \ else \ $(MAKE) $@ "VERSION=$(shell date '+%Y-%m-%dT%T')"; \ @@ -310,11 +374,72 @@ endif # Convenience targets to svn revert the generated files, # and svn diff the source files. +.PHONY: svr svd svr: svn revert $(addprefix $(manual)*., $(all_suffixes)) svd: svn diff $(foreach lang,$(languages),$(call txt_files,$(lang))) $(patsubst %,aspell.%.pws,$(languages)) *.texi + +# Target for comparing node lists between languages +# use target compare-nodes-fr to compare French & English together. +.PHONY: compare-nodes +#compare-nodes: $(addprefix compare-nodes-,$(other_languages)) +# For the time being we compare only French/English as the Spanish +# translation does not reuse the same node names +compare-nodes: compare-nodes-fr + +define _1 +.PHONY: compare-nodes-$(1) +compare-nodes-$(1): node-list-$(1).txt node-list-$(default_language).txt + if diff $$^; then :; \ + else echo "=================================="; \ + echo "Node list between $(1) and $(default_language) differ"; \ + echo "=================================="; \ + fi + +endef +$(eval $(foreach LANG,$(other_languages),$(call _1,$(LANG)))) + +define AWK_NODE_LIST +/^ *@node/ { gsub(/^ *@node +| *,.*$$$$/,""); print; } +endef + +define _1 +node-list-$(1).txt: $($(1)_manual).texi + awk '$(AWK_NODE_LIST)' $$< > $$@ + +endef +$(eval $(foreach LANG,$(languages),$(call _1,$(LANG)))) + +# shorthands for compiling just one output . +# for instance `make frinfo' is equivalent to `make latex2e-fr.info' +# `make enpdf`is is equivalent to `make latex2e.pdf'. etc. +define _1 +.PHONY: $(1)$(2) +$(1)$(2): $($(1)_manual).$(2) + +endef +$(eval $(foreach lang,$(languages),$(foreach suffix,$(suffixes),$(call _1,$(lang),$(suffix))))) + +comma:=, +define make_list +in {$(join $(1),$(patsubst %,$(comma),$(filter-out $(firstword $(1)),$(1))))} +endef + +.PHONY: help h ? +h ?:help +help: + @echo "Target tag to set an SVN tag to delivered version" + @echo "Target svr to revert all products" + @echo "Target svd to make an svn diff over all deliverable sources" + @echo "Target check-dw to check double words in .texi source for all languages" + @echo "Target check-dw-L to check double words in .texi source for language L $(call make_list,$(languages))" + @echo "Target updated-L to update version in .texi source for language L $(call make_list,$(languages))" + @echo "Target L to make all format for language L $(call make_list,$(languages))" + @echo "Target LF to make format F for language L $(call make_list,$(foreach L,$(languages),$(foreach F,$(suffixes),$(L)$(F))))" + @echo "Target compare-nodes-L to compare node list of language L to node list of $(default_language), for L $(call make_list,$(other_languages))" + # Local Variables: # coding: utf-8 # mode: makefile -- cgit v1.2.3