summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-10-26 23:11:36 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-10-26 23:11:36 +0000
commit4686ed60662db8be0f214becef6782717ae753b4 (patch)
treeaabe2cf565a835df1ec11a6a2aeaa1c5072b3613
parent798ec7bd13b51f2b9cdf6e2e186146a317b4ecb2 (diff)
downloadfedora-doc-utils-4686ed60662db8be0f214becef6782717ae753b4.tar.gz
fedora-doc-utils-4686ed60662db8be0f214becef6782717ae753b4.tar.xz
fedora-doc-utils-4686ed60662db8be0f214becef6782717ae753b4.zip
In preparation for RPM packaging, tweak the setup to:
1) Use a "${FDPDIR}" macro to locate the docs-common directory. 2) Use a macro to locate which xmlto we want to use. 3) Use the file "Make.paths" in the DOCUMENT directory, if any, to read macro values.
-rw-r--r--Makefile.common40
1 files changed, 27 insertions, 13 deletions
diff --git a/Makefile.common b/Makefile.common
index 7cece96..9dc61c4 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -21,18 +21,32 @@
# providing additional rules, also marked with double-colons, in the
# document Makefile.
#########################################################################
+# Allow client document to provide "Make.paths" file to locate our files
+# This is a "silent include", so if it's missing there is no problem.
+# This file, if present, must be in the DOCUMENT directory, not here in
+# docs-common. Even if this file is present, defining FTPDIR via the
+# command line will take precedence.
+sinclude Make.paths
+#########################################################################
# Supply default values for the boilerplate files _unless_ the user has
# provided their own values.
+ifeq (${FDPDIR},)
+FDPDIR = ..
+endif
ifeq (${XSLPDF},)
-XSLPDF = ../docs-common/xsl/main-pdf.xsl
+XSLPDF = ${FDPDIR}/docs-common/xsl/main-pdf.xsl
endif
ifeq (${XSLHTML},)
-XSLHTML = ../docs-common/xsl/main-html.xsl
+XSLHTML = ${FDPDIR}/docs-common/xsl/main-html.xsl
endif
ifeq (${XSHTMLNOCHUNKS},)
-XSLHTMLNOCHUNKS = ../docs-common/xsl/main-html-nochunks.xsl
+XSLHTMLNOCHUNKS = ${FDPDIR}/docs-common/xsl/main-html-nochunks.xsl
endif
#########################################################################
+# Define a macro to locate xmlto(1) so we can choose a specific version
+# by "make XMLTO=/path/to/xmlto", if we so desire.
+XMLTO =xmlto
+#########################################################################
# PUT NO TARGETS BEFORE THIS ONE, not even in your base Makefile
# In a properly-constructed Makefile, this will be the default target
@@ -46,17 +60,17 @@ ${TARGETS}::
#########################################################################
# For each LANG in LANGUAGES, generate a target and rule similar to:
# mydoc-en/index.html:: mydoc-en.xml ${XMLEXTRAFILES}-en
-# LANG=en.UTF-8 xmlto html -x $(XSLHTML) -o mydoc-en mydoc-en.xml
+# LANG=en.UTF-8 ${XMLTO} html -x $(XSLHTML) -o mydoc-en mydoc-en.xml
# mkdir -p mydoc-en/stylesheet-images
-# cp ../docs-common/stylesheet-images/*.png mydoc-en/stylesheet-images/
-# cp ../docs-common/css/fedora.css mydoc-en/
+# cp ${FDPDIR}/docs-common/stylesheet-images/*.png mydoc-en/stylesheet-images/
+# cp ${FDPDIR}/docs-common/css/fedora.css mydoc-en/
#
define HTML_template
${DOCBASE}-$(1)/index.html:: ${DOCBASE}-$(1).xml $$(XMLEXTRAFILES-$(1))
- LANG=$(1).UTF-8 xmlto html -x $(XSLHTML) -o $(DOCBASE)-$(1) $(DOCBASE)-$(1).xml
+ LANG=$(1).UTF-8 ${XMLTO} html -x $(XSLHTML) -o $(DOCBASE)-$(1) $(DOCBASE)-$(1).xml
mkdir -p $(DOCBASE)-$(1)/stylesheet-images/
- cp ../docs-common/stylesheet-images/*.png $(DOCBASE)-$(1)/stylesheet-images
- cp ../docs-common/css/fedora.css $$(DOCBASE)-$(1)/
+ cp ${FDPDIR}/docs-common/stylesheet-images/*.png $(DOCBASE)-$(1)/stylesheet-images
+ cp ${FDPDIR}/docs-common/css/fedora.css $$(DOCBASE)-$(1)/
endef
#
html:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG)/index.html)
@@ -67,10 +81,10 @@ $(foreach LANG,${LANGUAGES},$(eval $(call HTML_template,${LANG})))
# For each language in ${LANGUAGES}, generate a single HTML file
define HTMLNOCHUNK_template
${DOCBASE}-$(1).html:: ${DOCBASE}-$(1).xml $$(XMLEXTRAFILES-$(1))
- xmlto html-nochunks -x $(XSLHTMLNOCHUNKS) $(DOCBASE)-$(1).xml
+ ${XMLTO} html-nochunks -x $(XSLHTMLNOCHUNKS) $(DOCBASE)-$(1).xml
mkdir -p stylesheet-images/
- cp ../docs-common/stylesheet-images/*.png stylesheet-images/
- cp ../docs-common/css/fedora.css .
+ cp ${FDPDIR}/docs-common/stylesheet-images/*.png stylesheet-images/
+ cp ${FDPDIR}/docs-common/css/fedora.css .
endef
#
html-nochunks:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG).html)
@@ -94,7 +108,7 @@ $(foreach LANG,${LANGUAGES},$(eval $(call TAR_template,${LANG})))
# Format (PDF) file.
define PDF_template
${DOCBASE}-$(1).pdf:: ${DOCBASE}-$(1).xml $$(XMLEXTRAFILES-$(1))
- xmlto pdf -x $(XSLPDF) $(DOCBASE)-$(1).xml
+ ${XMLTO} pdf -x $(XSLPDF) $(DOCBASE)-$(1).xml
endef
#
pdf:: $(foreach LANG,${LANGUAGES},$(DOCBASE)-$(LANG).pdf)