summaryrefslogtreecommitdiffstats
path: root/Makefile.common
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-03-01 23:37:57 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-03-01 23:37:57 +0000
commitb4033fd0296aff8e2b60924c001548f884e1ad48 (patch)
tree68d8e808f386a3e8c8a0cc644384cf58a1da1514 /Makefile.common
parent995446ddf25b4bfca72e40cfbe9d9416a0f8aa86 (diff)
downloadfedora-doc-utils-b4033fd0296aff8e2b60924c001548f884e1ad48.tar.gz
fedora-doc-utils-b4033fd0296aff8e2b60924c001548f884e1ad48.tar.xz
fedora-doc-utils-b4033fd0296aff8e2b60924c001548f884e1ad48.zip
Added support for per-document translatable entities file.
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common43
1 files changed, 39 insertions, 4 deletions
diff --git a/Makefile.common b/Makefile.common
index 12a59fc..be1de84 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -110,9 +110,13 @@ LN =ln
#########################################################################
# Rules to produce .po files from .xml files. Get the tools to do this
# from the gnome-doc-utils RPM.
-.SUFFIXES: .po .pot .xml
+.SUFFIXES: .po .pot .ent .xml
%.po: %.xml
${XML2PO} $< >$@
+
+%.ent: %.xml
+ ${XSLTPROC} -o $@ --stringparam FDPCOMMONDIR "NONE" \
+ ${FDPDIR}/docs-common/common/entities/entities.xsl $<
#########################################################################
#########################################################################
@@ -152,7 +156,18 @@ LANGUAGES=${PRI_LANG} ${OTHERS}
# Expand the template the XMLFILES_template to produce XMLFILES-${LANG}
# macros that enumerate all of the input files for the document.
+define XMLFILENAME_template
+showvars::
+ @echo "XMLFILES-${1}=$${XMLFILES-${1}}"
+endef
+
$(foreach L,${LANGUAGES},$(eval $(call XMLFILES_template,${L})))
+# Append per-document entities file if any
+ifneq "${DOC_ENTITIES}" ""
+$(foreach L, ${LANGUAGES}, $(eval XMLFILES-${L}+=${L}/${DOC_ENTITIES}.xml))
+endif
+
+$(foreach L, ${LANGUAGES},$(eval $(call XMLFILENAME_template,${L})))
#
#########################################################################
@@ -757,20 +772,40 @@ showvars::
@echo "PWD=$(PWD)"
#########################################################################
+define DOC_ENTITIES_template
+${1}/${DOC_ENTITIES}.ent:: ${1}/${DOC_ENTITIES}.xml
+endef
+
+ifneq "${DOC_ENTITIES}" ""
+$(foreach L, ${PRI_LANG} ${OTHERS},$(eval $(call DOC_ENTITIES_template,${L})))
+
+showvars::
+ echo "DOC_ENTITIES=${DOC_ENTITIES}"
+endif
+
+#########################################################################
+
+#########################################################################
# 'LOCALE_template' issues rules and targets to symbolicly link the local
# file 'locale-entities.xml' to the per-locale entity files located in
# the "docs-common/common/entities/" directory.
#
-LOCALE_ENTITIES='locale-entities.xml'
+FDP_ENTITIES=fdp-entities.ent
define LOCALE_template
.PHONY: set-locale-${1}
set-locale-${1}::
${LN} -f -s ${FDPDIR}/docs-common/common/entities/entities-${1}.ent \
- ${LOCALE_ENTITIES}
+ ${FDP_ENTITIES}
+ifneq "${DOC_ENTITIES}" ""
+ ${LN} -f -s ${1}/${DOC_ENTITIES}.ent .
+endif
clean::
- ${RM} ${LOCALE_ENTITIES}
+ ${RM} ${FDP_ENTITIES}
+ifneq "${DOC_ENTITIES}" ""
+ ${RM} ${DOC_ENTITIES}
+endif
help::
@printf ${TFMT} 'set-locale-${1}' 'Link to locale ${1} FDP entities'