######################################################################## # Fedora Documentation Project Per-document Makefile # License: GPL # Copyright 2005,2006 Tommy Reynolds, MegaCoder.com ######################################################################## # # Document-specific definitions. # DOCBASE = about-fedora PRI_LANG = en_US FDPDIR = ${PWD}/../.. PKGNAME = ${DOCBASE} define XMLFILES_template XMLFILES-${1}= ${1}/${DOCBASE}.xml \ ${1}/comment.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 ######################################################################## ${PKGNAME}-${VERSION}/about-gnome.desktop:: about-gnome.desktop.in \ $(foreach LN,${OTHERS},${LN}/about-fedora.xml \ ${LN}/comment.xml) mkdir -p ${PKGNAME}-${VERSION} $(eval NAME_L10N=Name=$(shell ${XSLTPROC} \ about-title.xsl ${PRI_LANG}/about-fedora.xml)) $(eval COMMENT_L10N=Comment=$(shell ${XSLTPROC} \ about-comment.xsl ${PRI_LANG}/comment.xml)) $(eval EXEC_L10N=Exec=yelp ghelp:about-fedora) $(foreach L,${LANGUAGES},$(eval \ NAME_L10N+=\nName[${L}]=$(shell ${XSLTPROC} \ about-title.xsl ${L}/about-fedora.xml))) $(foreach L,${LANGUAGES},$(eval \ COMMENT_L10N+=\nComment[${L}]=$(shell ${XSLTPROC} \ about-comment.xsl ${L}/comment.xml))) sed -e 's!@NAME-L10N@!${NAME_L10N}!' -e 's!@COMMENT-L10N@!${COMMENT_L10N}!' -e 's!@EXEC-L10N@!${EXEC_L10N}!' $< > $@ # This could be combined with OMFVAR_template later... define PKGOMFVAR_template $(foreach F,${OMFINFILES},$(eval PKGOMFFILES-${1}+=$(patsubst \ %.omf.in,$(if $(findstring ${PRI_LANG},${1}),%-C.omf,%-${1}.omf), \ ${F}))) showvars-debug:: @echo "PKGOMFFILES-${1}=\"${PKGOMFFILES-${1}}\"" endef $(foreach L,${LANGUAGES},$(eval $(call PKGOMFVAR_template,${L}))) define PKGOMF_DOC_template .PHONY: pkgomf-${1}-${2} ifeq "${2}" "${PRI_LANG}" pkgomf-${1}-${2}:: ${PKGNAME}-${VERSION}/${1}-C.omf ${PKGNAME}-${VERSION}/${1}-C.omf:: ${2}/${1}.omf mkdir -p ${PKGNAME}-${VERSION} cp ${2}/${1}.omf $$@ else pkgomf-${1}-${2}:: ${PKGNAME}-${VERSION}/${1}-${2}.omf ${PKGNAME}-${VERSION}/${1}-${2}.omf:: ${2}/${1}.omf mkdir -p ${PKGNAME}-${VERSION} cp ${2}/${1}.omf $$@ endif endef $(foreach L,${LANGUAGES}, \ $(foreach F,$(patsubst %.omf.in,%,${OMFINFILES}), \ $(eval $(call PKGOMF_DOC_template,${F},${L})))) define PKGOMF_template .PHONY: pkgomf-${1} pkgomf-${1}:: $(foreach F,${PKGOMFFILES-${1}},${PKGNAME}-${VERSION}/${F}) $(eval PKGFILES-${1}+=$(foreach F,${PKGOMFFILES-${1}},${PKGNAME}-${VERSION}/${F})) endef $(foreach L,${LANGUAGES},$(eval $(call PKGOMF_template,${L}))) .PHONY: release-pkg release-pkg:: ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION}.tar.gz:: $(foreach L,${LANGUAGES},${PKGFILES-${L}}) \ ${PKGNAME}-${VERSION}/about-gnome.desktop mkdir -p ${PKGNAME}-${VERSION}/about-fedora/C && \ cp ${PRI_LANG}/about-fedora.xml \ ${PKGNAME}-${VERSION}/about-fedora/C $(foreach LN,${OTHERS},$(eval \ $(shell mkdir -p ${PKGNAME}-${VERSION}/about-fedora/${LN}))) $(foreach LN,${OTHERS},$(eval \ $(shell cp ${LN}/about-fedora.xml \ ${PKGNAME}-${VERSION}/about-fedora/${LN}))) 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'