Author: jtr
Update of /cvs/docs/docs-common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26295
Modified Files:
Makefile.common
Log Message:
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.
Index: Makefile.common
===================================================================
RCS file: /cvs/docs/docs-common/Makefile.common,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Makefile.common 17 Sep 2005 14:41:42 -0000 1.9
+++ Makefile.common 26 Oct 2005 23:11:36 -0000 1.10
@@ -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 @@
#########################################################################
# 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 @@
# 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 @@
# 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)
Show replies by date