[latexrefman-commits] r288 - /trunk/Makefile

vincent.b.1 at domain.hid vincent.b.1 at domain.hid
Fri Aug 1 08:23:54 CEST 2014


Author: vincentb1
Date: Fri Aug  1 08:23:54 2014
New Revision: 288

URL: http://svn.gna.org/viewcvs/latexrefman?rev=288&view=rev
Log:
Summary: Make it generic

Makefile is made more generic, with specific trings only in the first 3 variables.

Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.gna.org/viewcvs/latexrefman/trunk/Makefile?rev=288&r1=287&r2=288&view=diff
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Fri Aug  1 08:23:54 2014
@@ -1,11 +1,16 @@
 # Public domain.  Originally written 2006, Karl Berry.
 # Makefile for latexrefman.
+
+manual=latex2e
+default_language=en
+other_languages=es fr
+# Everything after this is generic
 
 texi2dvi = texi2dvi --batch --tidy --build-dir=$*.t2dvi
 texi2pdf = texi2pdf --batch --tidy --build-dir=$*.t2pdf
 #
 makeinfo = makeinfo
-texi2docbook = $(makeinfo) --docbook
+texi2docbook = $(makeinfo) --docbook -o $@
 texi2html = $(makeinfo) --html --no-split
 texi2info = $(makeinfo) --no-split
 texi2txt = $(makeinfo) --plaintext --no-split -o $@
@@ -16,7 +21,7 @@
 %.dvi: %.texi
 	$(texi2dvi) $<
 %.dbk: %.texi
-	$(texi2docbook) -o $@ $<
+	$(texi2docbook) $<
 %.html: %.texi
 	$(texi2html) $<
 %.info: %.texi
@@ -26,34 +31,47 @@
 %.xml: %.texi
 	$(texi2xml) $<
 
-en_tex_output = latex2e.dvi latex2e.pdf
-es_tex_output = latex2e-es.dvi latex2e-es.pdf
-tex_output = $(en_tex_output) $(es_tex_output)
-#
-en_makeinfo_output = latex2e.info latex2e.html latex2e.txt \
-                     latex2e.xml  latex2e.dbk
-es_makeinfo_output = latex2e-es.info latex2e-es.html latex2e-es.txt \
-                     latex2e-es.xml  latex2e-es.dbk
-makeinfo_output = $(en_makeinfo_output) $(es_makeinfo_output)
+es_longname:=spanish
+fr_longname:=french
+de_longname:=german
+ru_longname:=russian
 
+languages=$(default_language) $(other_languages)
+define lang_def_template
+$(1)_tex_output = $$(addprefix $(manual)$$(filter-out -$(default_language),-$(1)).,dvi pdf)
+$(1)_makeinfo_output = $$(addprefix $(manual)$$(filter-out -$(default_language),-$(1)).,\
+		info html txt xml dbk)
+tex_output+= $$($(1)_tex_output)
+makeinfo_output+= $$($(1)_makeinfo_output)
+endef
+$(foreach lang,$(languages),\
+		$(eval $(call lang_def_template,$(lang))))
+
+.PHONY: all
 all: makeinfo_output tex_output
+
+.PHONY: makeinfo_output
 makeinfo_output: $(makeinfo_output)
+.PHONY: tex_output
 tex_output: $(tex_output)
 
+.PHONY: mostlyclean clean
 mostlyclean clean:
-	rm -rf latex2e.t2*
+	rm -rf $(manual).t2*
 
+.PHONY: realclean distclean
 realclean distclean: clean
 	rm -f $(all)
 
-dist = latex2e-help-texinfo.zip
+dist = $(manual)-help-texinfo.zip
+.PHONY: dist
 dist: all
 	@rm -f spanish; ln -s . spanish
-	@mkdir latex2e-help-texinfo; cd latex2e-help-texinfo; ln -s ../* .
+	@mkdir $(manual)-help-texinfo; cd $(manual)-help-texinfo; ln -s ../* .
 	zip -q $(dist) \
-$(addprefix latex2e-help-texinfo/, ChangeLog Makefile NEWS README ltx-help.el \
-                              latex2e.texi $(en_makeinfo_output) latex2e.pdf) \
-$(addprefix latex2e-help-texinfo/spanish/, \
-                        latex2e-es.texi $(es_makeinfo_output) latex2e-es.pdf)
-	@rm -rf latex2e-help-texinfo spanish
+$(addprefix $(manual)-help-texinfo/, ChangeLog Makefile NEWS README ltx-help.el \
+                              $(manual).texi $($(default_language)_makeinfo_output) $(manual).pdf) \
+$(foreach lang,$(other_languages),$(addprefix $(manual)-help-texinfo/$($(lang)_longname)/, \
+                        $(manual)-$(lang).texi $($(lang)_makeinfo_output) $(manual)-$(lang).pdf))
+	@rm -rf $(manual)-help-texinfo $(foreach lang,$(other_languages),$($(lang)_longname))
 	@ls -l $(dist); unzip -t $(dist)





More information about the latexrefman-commits mailing list