press-release Makefile,1.6,1.7

Tommy Reynolds (jtr) fedora-docs-commits at redhat.com
Wed Mar 15 15:12:14 UTC 2006


Author: jtr

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

Modified Files:
	Makefile 
Log Message:
DROPPED support for text output, for now we only support PDF output.
Added copious "make help" documentation.



Index: Makefile
===================================================================
RCS file: /cvs/docs/press-release/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile	15 Mar 2006 06:58:54 -0000	1.6
+++ Makefile	15 Mar 2006 15:11:49 -0000	1.7
@@ -18,9 +18,7 @@
 XMLTOFLAGS=-m params.xsl
 XSL	=fdp-pr.xsl
 SED    =/bin/sed
-XML2POT	=xml2pot
 XML2PO	=xml2po
-PO2XML	=po2xml
 MSGMERGE=msgmerge
 MSGMERGEFLAGS=
 ########################################################################
@@ -32,20 +30,31 @@
 ########################################################################
 # 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:	all clean distclean clobber pot help
 ########################################################################
 # The default target "all"
 all::	${DOC_BASE}.pot
 all::	$(foreach LOCALE,${LANGUAGES},${DOC_BASE}-${LOCALE}.pdf)
-all::	$(foreach LOCALE,${LANGUAGES},${DOC_BASE}-${LOCALE}.txt)
+# FIXME all::	$(foreach LOCALE,${LANGUAGES},${DOC_BASE}-${LOCALE}.txt)
+########################################################################
+HFMT	=%-31s\t%s\n
+help::
+	@printf "${HFMT}" "all" "Default target; generate PDF's"
+	@printf "${HFMT}" "clean" "Delete temporary files"
+	@printf "${HFMT}" "distclean" "Delete output and temporary files"
+	@printf "${HFMT}" "clobber" "Delete output and temporary files"
+	@printf "${HFMT}" "help" "This message; use 'make help|sort'"
 ########################################################################
 # Compute the rules to transform our XML documents into both PDF and TXT
 # forms
-define	OUTPUT_template
+define	PDF_template
 .PHONY:	pdf-${1}
 
 pdf-${1}:: ${DOC_BASE}-${1}.pdf
 
+help::
+	@printf "${HFMT}" "pdf-${1}" "Generate PDF for locale '${1}'"
+
 ${DOC_BASE}-$(1).pdf::	${DOC_BASE}-$(1).xml params.xsl.in ${XSL}
 	LC_ALL=${1}.UTF-8 ${SED} 					\
 	       -e "s|DATE|$$(shell LC_ALL=${1} date +'%x %X')|" 	\
@@ -53,42 +62,67 @@
 	       params.xsl.in >params.xsl
 	LC_ALL=${1}.UTF-8 ${XMLTO} -x ${XSL} ${XMLTOFLAGS} pdf 		\
 	       ${DOC_BASE}-$(1).xml
-	${RM} params.xsl
+
+help::
+	@printf "${HFMT}" "${DOC_BASE}-${1}.pdf" "Render PDF for locale '${1}'"
 
 distclean::
 	${RM} ${DOC_BASE}-${1}.pdf
+endef
+
+$(foreach LOCALE,${LANGUAGES},$(eval $(call PDF_template,${LOCALE})))
+########################################################################
 
-# This assumes w3m(1) is installed.
+########################################################################
+define	TXT_template
+# This assumes w3m(1) is installed.  The stock xmlto RPM uses it.
 XMLPOSTFLAGS=-p '-cols 72'
 
 .PHONY:	txt-${1}
 
 txt-${1}:: ${DOC_BASE}-${1}.txt
 
+help::
+	@printf "${HFMT}" "txt-${1}" "Generate text version for locale '${1}'"
+
 ${DOC_BASE}-$(1).txt::	${DOC_BASE}-$(1).xml params.xsl.in ${XSL}
 	LC_ALL=${1}.UTF-8 ${SED} 					\
 	       -e "s|DATE|$$(shell LC_ALL=${1} date +'%x %X')|"		\
 	       params.xsl.in >params.xsl
 	LC_ALL=${1}.UTF-8 ${XMLTO} -x ${XSL} ${XMLTOFLAGS} $${XMLPOSTFLAGS} \
 	       txt ${DOC_BASE}-$(1).xml
-	${RM} params.xsl
+
+help::
+	@printf "${HFMT}" "${DOC_BASE}-${1}.txt" "Render locale '${1}' text"
 
 distclean::
 	${RM} ${DOC_BASE}-${1}.txt
 endef
-
-$(foreach LOCALE,${LANGUAGES},$(eval $(call OUTPUT_template,${LOCALE})))
+# FIXME $(foreach LOCALE,${LANGUAGES},$(eval $(call TXT_template,${LOCALE})))
 ########################################################################
 # Always generate the current date.
 params.xsl: params.xsl.in Makefile
-	${SED} -e "s|DATE|$$(date +'%x %X')|" 				\
+	${SED} -e "s|DATE|$$(LC_ALL=${PRI_LANG} date +'%x %X')|" 	\
 	       -e "s|LANG|${PRI_LANG}|"					\
 		$< >$@.tmp && move-if-change $@.tmp $@
+
+help::
+	@printf "${HFMT}" "params.xsl" "Generate dynamic parameters"
 ########################################################################
 # The ${DOC_BASE}.pot target produces a new .POT file everytime the
 # original XML file is updated.
-${DOC_BASE}.pot: ${DOC_BASE}-${PRI_LANG}.xml
+.PHONY:	pot
+
+pot::	${DOC_BASE}.pot
+
+help::
+	@printf "${HFMT}" "pot" "Generate .POT file for translation"
+
+${DOC_BASE}.pot:: ${DOC_BASE}-${PRI_LANG}.xml
 	xml2po -o $@ $<
+
+help::
+	@printf "${HFMT}" "${DOC_BASE}.pot" "Generate .POT file for translation"
 ########################################################################
 # 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
@@ -98,6 +132,9 @@
 .PHONY:	po-${1}
 po-${1}::	${1}.po
 
+help::
+	@printf "${HFMT}" "po-${1}" "Update translations for locale '${1}'"
+
 .PRECIOUS: ${1}.po
 ${1}.po:: ${DOC_BASE}.pot
 	@if [ ! -f ${1}.po ]; then					\
@@ -108,6 +145,9 @@
 		${MSGMERGE} ${MSGMERGEFLAGS} 				\
 			${1}.po $${DOC_BASE}.pot >${1}.po;		\
 	fi
+
+help::
+	@printf "${HFMT}" "${1}.po" "Update translations for locale '${1}'"
 endef
 
 $(foreach LOCALE,${OTHERS},$(eval $(call PO_template,${LOCALE})))
@@ -118,14 +158,27 @@
 .PHONY:	xml-${1}
 xml-${1}::	${DOC_BASE}-${1}.xml
 
+help::
+	@printf "${HFMT}" "xml-${1}" "Translate XML for locale '${1}'"
+
 ${DOC_BASE}-${1}.xml:: ${DOC_BASE}-${PRI_LANG}.xml ${1}.po
-	${PO2XML} ${DOC_BASE}-${PRI_LANG}.xml ${1}.po >${DOC_BASE}-${1}.xml
+	${XML2PO} -p ${1}.po ${DOC_BASE}-${PRI_LANG}.xml >${DOC_BASE}-${1}.xml
+
+help::
+	@printf "${HFMT}" "${DOC_BASE}-${1}.xml" "Create XML for locale '${1}'"
 
 clean::
 	${RM} ${DOC_BASE}-${1}.xml
 endef
 
 $(foreach LOCALE,${OTHERS},$(eval $(call NEWLANG_template,${LOCALE})))
+
+.PHONY:	xml-${PRI_LANG}
+
+xml-${PRI_LANG}:: ${DOC_BASE}-${PRI_LANG}.xml
+
+help::
+	@printf "${HFMT}" "${DOC_BASE}-${PRI_LANG}.xml" "Primary XML"
 ########################################################################
 clean::
 	${RM} params.xml
@@ -134,6 +187,8 @@
 .PHONY:	mrproper
 mrproper:: distclean
 	${RM} *.po
+	${RM} *.pdf
+	${RM} *.txt
 ########################################################################
 # End of Makefile
 ########################################################################




More information about the Fedora-docs-commits mailing list