diff options
Diffstat (limited to 'Makefile.common')
-rw-r--r-- | Makefile.common | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/Makefile.common b/Makefile.common index cc7ace7..5af73ea 100644 --- a/Makefile.common +++ b/Makefile.common @@ -2,18 +2,8 @@ # Makefile.common # # This file, to be included from every document's local Makefile, provides -# the basic targets used by the Fedora Docs Project: -# all -- Default target, builds HTML document only -# ${DOCNAME}/index.html -- Builds HTML version of document -# html -- See "${DOCNAME}/index.html" -# html-nochunks -- See "${DOCNAME}.html"; single HTML file -# ${DOCNAME}.tar.gz -- Packages HTML document into a tar archive -# tarball -- See "${DOCNAME}.tar.gz" -# clean -- Deletes all generated files and directories -# distclean -- See "clean" -# ${DOCNAME}.pdf -- Builds PDF version of document -# pdf -- See "${DOCNAME}.pdf" -# txt -- Make ASCII txt version +# the basic targets used by the Fedora Docs Project. To see a list, +# type "make help". ######################################################################### ######################################################################### @@ -480,21 +470,41 @@ tarball:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG).tar.gz) ######################################################################### # For each language in ${LANGUAGES}, generate an Adobe Portable Document # Format (PDF) file. +define FO_template +.PHONY: fo-${1} +fo-${1}:: ${1}/${DOCBASE}.fo +${1}/${DOCBASE}.fo:: ${XMLFILES-${1}} ${XMLDEPFILES-${1}} set-locale-${1} + LANG=${1}.UTF-8 xsltproc --xinclude ${XSLPDF} \ + ${1}/${DOCBASE}.xml | ${XMLLINT} --format -o $$@ - +clean:: + ${RM} ${1}/${DOCBASE}.fo +help:: + @printf ${TFMT} 'fo-${1}' 'Creates ${1}/${DOCBASE}.fo file' + @printf ${TFMT} '${1}/${DOCBASE}.fo' 'XSL-FO file for locale ${1}' +endef + +$(foreach L,${LANGUAGES},$(eval $(call FO_template,${L}))) + +.PHONY: fo fo-all +fo fo-all:: $(foreach L,${LANGUAGES},fo-${L}) +help:: + @printf ${TFMT} 'fo' 'Generate .FO files for all languages' + @printf ${TFMT} 'fo-all' 'Generate .FO files for all languages' + define PDF_template .PHONY: pdf-${1} - pdf-$(1):: ${DOCBASE}-$(1).pdf -${DOCBASE}-$(1).pdf:: ${XMLFILES-${1}} ${XMLDEPFILES-${1}} set-locale-${1} - LANG=${1}.UTF-8 ${XMLTO} pdf -x $(XSLPDF) $(1)/$(DOCBASE).xml - mv -f ${DOCBASE}.pdf ${DOCBASE}-${1}.pdf +${DOCBASE}-${1}.pdf:: ${1}/${DOCBASE}.fo + LANG=${1}.UTF-8 ${XMLTO} -o ${1} pdf $$< + mv -f ${1}/${DOCBASE}.pdf $$@ distclean:: ${RM} ${DOCBASE}-${1}.pdf help:: - @printf ${TFMT} 'pdf-${1}' 'Renders XML into PDF file for locale ${1}' - @printf ${TFMT} '${DOCBASE}-${1}.pdf' 'Renders XML into PDF file' + @printf ${TFMT} 'pdf-${1}' 'Renders XML-FO into PDF for locale ${1}' + @printf ${TFMT} '${DOCBASE}-${1}.pdf' 'Renders XML-FO into PDF file' endef |