press-release Makefile,1.3,1.4

Tommy Reynolds (jtr) fedora-docs-commits at redhat.com
Tue Mar 14 23:05:02 UTC 2006


Author: jtr

Update of /cvs/docs/press-release
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18007

Modified Files:
	Makefile 
Log Message:
Replace usage of "xml2pot" with "xml2o" to match FDP toolchain
expectations.

Much cleanup.



Index: Makefile
===================================================================
RCS file: /cvs/docs/press-release/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile	11 Mar 2006 17:22:43 -0000	1.3
+++ Makefile	14 Mar 2006 23:04:52 -0000	1.4
@@ -2,9 +2,9 @@
 # The ${DOC_BASE} symbol provides the basic name for this document.
 DOC_BASE=fdp-pr
 ########################################################################
-# The ${LANG} symbol gives the locale for the original language for 
+# The ${PRI_LANG} symbol gives the locale for the original language for 
 # the document.
-LANG=en_US
+PRI_LANG=en_US
 ########################################################################
 # The ${OTHERS} symbol is a list of additional locales into which the
 # document is to be translated.
@@ -24,6 +24,8 @@
 MSGMERGE=msgmerge
 MSGMERGEFLAGS=
 ########################################################################
+LANGUAGES=${PRI_LANG} ${OTHERS}
+########################################################################
 # Define our own set of suffixes to streamline the process
 .SUFFIXES:
 .SUFFIXES:	.txt	.pdf	.po	.pot	.xml	.xsl	.dtd	.in
@@ -31,31 +33,38 @@
 # Mark the proper virtual targets so that a "make -t all" does not create
 # an empty file called "all".
 .PHONY:	all clean distclean clobber pot
-.PHONY: $(foreach LOCALE,${OTHERS},xml-${LOCALE})
-.PHONY: $(foreach LOCALE,${OTHERS},po-${LOCALE})
 ########################################################################
 # The default target "all"
 all::	${DOC_BASE}.pot
-all::	$(foreach LOCALE,${LANG} ${OTHERS},${DOC_BASE}-${LOCALE}.xml)
-all::	$(foreach LOCALE,${LANG} ${OTHERS},${DOC_BASE}-${LOCALE}.pdf)
-all::	$(foreach LOCALE,${LANG} ${OTHERS},${DOC_BASE}-${LOCALE}.txt)
+all::	$(foreach LOCALE,${LANGUAGES},${DOC_BASE}-${LOCALE}.pdf)
+all::	$(foreach LOCALE,${LANGUAGES},${DOC_BASE}-${LOCALE}.txt)
 ########################################################################
 # Compute the rules to transform our XML documents into both PDF and TXT
 # forms
 define	OUTPUT_template
+
 ${DOC_BASE}-$(1).pdf::	${DOC_BASE}-$(1).xml params.xsl.in
 	LC_ALL=${1}.UTF-8 ${SED} -e "s|DATE|$$(date +'%x %X')|" 	\
 	       params.xsl.in >params.xsl
 	LC_ALL=${1}.UTF-8 ${XMLTO} -x ${XSL} ${XMLTOFLAGS} pdf 		\
 	       ${DOC_BASE}-$(1).xml
+	${RM} params.xsl
+
+distclean::
+	${RM} ${DOC_BASE}-${1}.pdf
+
 ${DOC_BASE}-$(1).txt::	${DOC_BASE}-$(1).xml params.xsl.in
 	LC_ALL=${1}.UTF-8 ${SED} -e "s|DATE|$$(date +'%x %X')|" 	\
 	       params.xsl.in >params.xsl
 	LC_ALL=${1}.UTF-8 ${XMLTO} -x ${XSL} ${XMLTOFLAGS} txt 		\
 	       ${DOC_BASE}-$(1).xml
+	${RM} params.xsl
+
+distclean::
+	${RM} ${DOC_BASE}-${1}.txt
 endef
 
-$(foreach LOCALE,${LANG} ${OTHERS},$(eval $(call OUTPUT_template,${LOCALE})))
+$(foreach LOCALE,${LANGUAGES},$(eval $(call OUTPUT_template,${LOCALE})))
 ########################################################################
 # Always generate the current date.
 params.xsl: params.xsl.in
@@ -63,15 +72,19 @@
 ########################################################################
 # The ${DOC_BASE}.pot target produces a new .POT file everytime the
 # original XML file is updated.
-${DOC_BASE}.pot: ${DOC_BASE}-${LANG}.xml
-	xml2pot $< >$@
+${DOC_BASE}.pot: ${DOC_BASE}-${PRI_LANG}.xml
+	xml2po -o $@ $<
 ########################################################################
 # Compute the rules to create or update a language-specific .po file
 # any time the ${DOC_BASE}.pot file is updated.  We try to avoid losing
 # current .PO translations by calling msgmerge if a .po file already 
 # exists.
 define PO_template
-po-${1} ${1}.po:: ${DOC_BASE}.pot
+.PHONY:	po-${1}
+po-${1}::	${1}.po
+
+.PRECIOUS: ${1}.po
+${1}.po:: ${DOC_BASE}.pot
 	@if [ ! -f ${1}.po ]; then					\
 		echo Creating pristine ${1}.po;				\
 		cp ${DOC_BASE}.pot ${1}.po;				\
@@ -87,20 +100,25 @@
 # Compute the rules and targets to generate the translated XML files
 # given an updated .PO file and the source XML file.
 define NEWLANG_template
-xml-${1} ${DOC_BASE}-${1}.xml:: ${DOC_BASE}-${LANG}.xml ${1}.po
-	${PO2XML} ${DOC_BASE}-${LANG}.xml ${1}.po >${DOC_BASE}-${1}.xml
+.PHONY:	xml-${1}
+xml-${1}::	${DOC_BASE}-${1}.xml
+
+${DOC_BASE}-${1}.xml:: ${DOC_BASE}-${PRI_LANG}.xml ${1}.po
+	${PO2XML} ${DOC_BASE}-${PRI_LANG}.xml ${1}.po >${DOC_BASE}-${1}.xml
+
+clean::
+	${RM} ${DOC_BASE}-${1}.xml
 endef
 
 $(foreach LOCALE,${OTHERS},$(eval $(call NEWLANG_template,${LOCALE})))
 ########################################################################
-# Neatness counts
-clean:
-	${RM} $(foreach LOCALE,${OTHERS},${DOC_BASE}-${LOCALE}.xml)
-	${RM} params.xsl
-
-distclean clobber: clean
-	${RM} $(foreach LOCALE,${LANG} ${OTHERS},${DOC_BASE}-${LOCALE}.pdf)
-	${RM} $(foreach LOCALE,${LANG} ${OTHERS},${DOC_BASE}-${LOCALE}.txt)
+clean::
+	${RM} params.xml
+distclean clobber:: clean
+########################################################################
+.PHONY:	mrproper
+mrproper:: distclean
+	${RM} *.po
 ########################################################################
 # End of Makefile
 ########################################################################




More information about the docs-commits mailing list