######################################################################## # Fedora Documentation Project Per-document Makefile # License: GPL # Copyright 2005,2006 Tommy Reynolds, MegaCoder.com ######################################################################## # # Document-specific definitions. # DOCBASE = homepage PRI_LANG = en_US OTHERS = ca el es fi fr it ja nl pa pl pt_BR pt sr sv uk zh_CN # bn_IN cs de gu hr ml ms nb ru zh_TW PKGNAME = ${DOCBASE} # Set this locally VERSION = 7.0.0 define XMLFILES_template XMLFILES-${1}= ${1}/homepage.xml endef # ######################################################################## define find-makefile-common for d in docs-common ../docs-common ../../docs-common; do \ if [ -f $$d/Makefile.common ]; then echo "$$d/Makefile.common"; break; fi; done endef include $(shell $(find-makefile-common)) ######################################################################## # # If you want to add additional steps to any of the # targets defined in "Makefile.common", be sure to use # a double-colon in your rule here. For example, to # print the message "FINISHED AT LAST" after building # the HTML document version, uncomment the following # line: #${DOCBASE}-en/index.html:: # echo FINISHED AT LAST ######################################################################## define HACK_HTML_template .PHONY: homepage-${1} $(eval HOMEPAGEDIR=homepage) $(eval HTMLEXTRAFILES-${1}=${HOMEPAGEDIR}/index-${1}.html) $(eval HOMEPAGE_CSS=${HOMEPAGEDIR}/homepage.css) $(eval HOMEPAGE_XSL=${HOMEPAGEDIR}/homepage.xsl) homepage-${1}:: ${HOMEPAGEDIR}/index-${1}.html ${HOMEPAGEDIR}/index-${1}.html:: ${1}/homepage.xml ${XMLDEPFILES-${1}} # Can we get away with just the above? Let's see... LANG=$(1).UTF-8 ${XMLTO} html -x $(XSLHTML) -m ${HOMEPAGE_XSL} $(1)/homepage.xml move-if-change index.html ${HOMEPAGEDIR}/index-${1}.html mkdir -p stylesheet-images/ cp ${FDPCOMMONDIR}/stylesheet-images/*.png stylesheet-images clean:: rm -rf ${HOMEPAGEDIR}/index-${1}.html stylesheet-images/ endef $(foreach L,${LANGUAGES},$(eval $(call HACK_HTML_template,${L}))) define PKGHTML_HOMEPAGE_template .PHONY: pkghtml-homepage-${1} pkghtml-homepage-${1}:: ${PKGNAME}-${VERSION}/${HOMEPAGEDIR}/index-${1}.html $(eval PKGFILES-${1}+=${PKGNAME}-${VERSION}/${HOMEPAGEDIR}/index-${1}.html) ${PKGNAME}-${VERSION}/${HOMEPAGEDIR}/index-${1}.html:: ${HOMEPAGEDIR}/index-${1}.html mkdir -p ${PKGNAME}-${VERSION}/${HOMEPAGEDIR} cp ${HOMEPAGEDIR}/index-${1}.html $$@ endef $(foreach L,${LANGUAGES},$(eval $(call PKGHTML_HOMEPAGE_template,${L}))) .PHONY: release-pkg release-pkg:: ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION}.tar.gz:: $(foreach L,${LANGUAGES},${PKGFILES-${L}}) cp -a --parents ${HOMEPAGE_CSS} img/*png stylesheet-images/*png ${PKGNAME}-${VERSION} tar czf ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION} clean:: ${RM} -rf ${PKGNAME}-${VERSION}.tar.gz ${RM} -rf ${PKGNAME}-${VERSION} help:: @printf ${TFMT} 'release-pkg' 'Make a tarball suitable for import to Core'