1. Shlomi Fish
  2. shlomi-fish-homepage

Commits

shl...@iglu.org.il@cec68495-dca5-4e2b-845c-11fdaaa4f967  committed 20c3344

Integrated the DocBook 5 building.

  • Participants
  • Parent commits d7621c7
  • Branches default

Comments (0)

Files changed (3)

File Makefile

View file
 
 include lib/make/docbook/sf-homepage-docbooks-generated.mak
 
-DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS_CSS = $(patsubst %,%/style.css,$(DOCBOOK_INDIVIDUAL_XHTMLS))
-DOCBOOK_INSTALLED_CSS_DIRS = $(foreach doc,$(DOCBOOK_DOCS),$(T2_DEST)/$(call get,DOCBOOK_DIRS_MAP,$(doc))/docbook-css)
+DOCBOOK4_INSTALLED_INDIVIDUAL_XHTMLS_CSS = $(patsubst %,%/style.css,$(DOCBOOK4_INDIVIDUAL_XHTMLS))
+DOCBOOK4_INSTALLED_CSS_DIRS = $(foreach doc,$(DOCBOOK4_DOCS),$(T2_DEST)/$(call get,DOCBOOK4_DIRS_MAP,$(doc))/docbook-css)
 DOCMAKE_STYLE_CSS = $(DOCMAKE_XSLT_PATH)/style.css
 
-DOCBOOK_BASE_DIR = lib/docbook
-DOCBOOK_RENDERED_DIR = $(DOCBOOK_BASE_DIR)/rendered
-DOCBOOK_ALL_IN_ONE_XHTML_DIR = $(DOCBOOK_BASE_DIR)/essays
+DOCBOOK4_BASE_DIR = lib/docbook
+DOCBOOK4_RENDERED_DIR = $(DOCBOOK4_BASE_DIR)/rendered
+DOCBOOK4_ALL_IN_ONE_XHTML_DIR = $(DOCBOOK4_BASE_DIR)/essays
 
 SCREENPLAY_XML_BASE_DIR = lib/screenplay-xml
 SCREENPLAY_XML_XML_DIR = $(SCREENPLAY_XML_BASE_DIR)/xml
 SCREENPLAY_XML_HTML_DIR = $(SCREENPLAY_XML_BASE_DIR)/html
 SCREENPLAY_XML_RENDERED_HTML_DIR = $(SCREENPLAY_XML_BASE_DIR)/rendered-html
 
-DOCBOOK_TARGETS = $(patsubst %,$(DOCBOOK_RENDERED_DIR)/%.html,$(DOCBOOK_DOCS))
-DOCBOOK_XMLS = $(patsubst %,$(DOCBOOK_XML_DIR)/%.xml,$(DOCBOOK_DOCS))
+DOCBOOK4_TARGETS = $(patsubst %,$(DOCBOOK4_RENDERED_DIR)/%.html,$(DOCBOOK4_DOCS))
+DOCBOOK4_XMLS = $(patsubst %,$(DOCBOOK4_XML_DIR)/%.xml,$(DOCBOOK4_DOCS))
 
 SCREENPLAY_XMLS = $(patsubst %,$(SCREENPLAY_XML_XML_DIR)/%.xml,$(SCREENPLAY_DOCS))
 SCREENPLAY_HTMLS = $(patsubst %,$(SCREENPLAY_XML_HTML_DIR)/%.html,$(SCREENPLAY_DOCS))
 
-DOCBOOK_FOS = $(patsubst %,$(DOCBOOK_FO_DIR)/%.fo,$(DOCBOOK_DOCS))
+DOCBOOK4_FOS = $(patsubst %,$(DOCBOOK4_FO_DIR)/%.fo,$(DOCBOOK4_DOCS))
 
-DOCBOOK_PDFS = $(patsubst %,$(DOCBOOK_PDF_DIR)/%.pdf,$(DOCBOOK_DOCS))
+DOCBOOK4_PDFS = $(patsubst %,$(DOCBOOK4_PDF_DIR)/%.pdf,$(DOCBOOK4_DOCS))
 
-DOCBOOK_RTFS = $(patsubst %,$(DOCBOOK_RTF_DIR)/%.rtf,$(DOCBOOK_DOCS))
+DOCBOOK4_RTFS = $(patsubst %,$(DOCBOOK4_RTF_DIR)/%.rtf,$(DOCBOOK4_DOCS))
 
-DOCBOOK_INDIVIDUAL_XHTMLS = $(patsubst %,$(DOCBOOK_INDIVIDUAL_XHTML_DIR)/%,$(DOCBOOK_DOCS))
+DOCBOOK4_INDIVIDUAL_XHTMLS = $(patsubst %,$(DOCBOOK4_INDIVIDUAL_XHTML_DIR)/%,$(DOCBOOK4_DOCS))
 
-DOCBOOK_ALL_IN_ONE_XHTMLS = $(patsubst %,$(DOCBOOK_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html,$(DOCBOOK_DOCS))
+DOCBOOK4_ALL_IN_ONE_XHTMLS = $(patsubst %,$(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html,$(DOCBOOK4_DOCS))
 
 # We have our own style for human-hacking-field-guide so we get rid of it.
-DOCBOOK_ALL_IN_ONE_XHTMLS_CSS = $(patsubst %/all-in-one.html,%/style.css,$(filter-out human-hacking-%,$(DOCBOOK_ALL_IN_ONE_XHTMLS)))
+DOCBOOK4_ALL_IN_ONE_XHTMLS_CSS = $(patsubst %/all-in-one.html,%/style.css,$(filter-out human-hacking-%,$(DOCBOOK4_ALL_IN_ONE_XHTMLS)))
 
 SCREENPLAY_RENDERED_HTMLS = $(patsubst %,$(SCREENPLAY_XML_RENDERED_HTML_DIR)/%.html,$(SCREENPLAY_DOCS))
 
 
 SCREENPLAY_SOURCES_ON_DEST = $(T2_DEST)/humour/TOWTF/TOW_Fountainhead_1.txt $(T2_DEST)/humour/TOWTF/TOW_Fountainhead_2.txt $(T2_DEST)/humour/humanity/Humanity-Movie.txt $(T2_DEST)/humour/Star-Trek/We-the-Living-Dead/star-trek--we-the-living-dead.txt $(T2_DEST)/open-source/interviews/ae-interview.txt $(T2_DEST)/open-source/interviews/sussman-interview.txt $(T2_DEST)/humour/Blue-Rabbit-Log/Blue-Rabbit-Log-Part-1.txt
 
-docbook_extended: $(DOCBOOK_FOS) $(DOCBOOK_PDFS) install_docbook_pdfs install_docbook_rtfs 
+docbook_extended: $(DOCBOOK4_FOS) $(DOCBOOK4_PDFS) \
+	install_docbook4_pdfs install_docbook4_rtfs \
+	install_docbook5_pdfs install_docbook5_rtfs 
 
-docbook_indiv: $(DOCBOOK_INDIVIDUAL_XHTMLS)
+docbook_indiv: $(DOCBOOK4_INDIVIDUAL_XHTMLS)
 
-docbook_targets: $(DOCBOOK_TARGETS) $(DOCBOOK_ALL_IN_ONE_XHTMLS) $(DOCBOOK_ALL_IN_ONE_XHTMLS_CSS) $(ST_WTLD_TEXT_IN_TREE) $(SCREENPLAY_RENDERED_HTMLS) $(SCREENPLAY_SOURCES_ON_DEST) install_docbook_xmls install_docbook_individual_xhtmls install_docbook_css_dirs docbook_hhfg_images
+screenplay_targets: $(ST_WTLD_TEXT_IN_TREE) $(SCREENPLAY_RENDERED_HTMLS) $(SCREENPLAY_SOURCES_ON_DEST) 
 
-$(DOCBOOK_RENDERED_DIR)/%.html: $(DOCBOOK_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html
+docbook_targets: docbook4_targets screenplay_targets \
+	install_docbook4_xmls install_docbook_individual_xhtmls install_docbook_css_dirs docbook_hhfg_images docbook5_targets install_docbook5_xmls
+
+docbook4_targets: $(DOCBOOK4_TARGETS) $(DOCBOOK4_ALL_IN_ONE_XHTMLS) $(DOCBOOK4_ALL_IN_ONE_XHTMLS_CSS)
+
+docbook5_targets: $(DOCBOOK5_TARGETS) $(DOCBOOK5_ALL_IN_ONE_XHTMLS) $(DOCBOOK5_ALL_IN_ONE_XHTMLS_CSS)
+
+$(DOCBOOK4_RENDERED_DIR)/%.html: $(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html
 	./bin/clean-up-docbook-xsl-xhtml.pl -o $@ $<
 
-$(DOCBOOK_FO_DIR)/%.fo: $(DOCBOOK_XML_DIR)/%.xml
+$(DOCBOOK4_FO_DIR)/%.fo: $(DOCBOOK4_XML_DIR)/%.xml
 	$(DOCMAKE_WITH_PARAMS) -o $@ --stringparam "docmake.output.format=fo" -x $(FO_XSLT_SS) fo $<
 
-$(DOCBOOK_PDF_DIR)/%.pdf: $(DOCBOOK_FO_DIR)/%.fo
+
+$(DOCBOOK4_PDF_DIR)/%.pdf: $(DOCBOOK4_FO_DIR)/%.fo
 	fop -fo $< -pdf $@
 
-$(DOCBOOK_RTF_DIR)/%.rtf: $(DOCBOOK_FO_DIR)/%.fo
+$(DOCBOOK4_RTF_DIR)/%.rtf: $(DOCBOOK4_FO_DIR)/%.fo
 	fop -fo $< -rtf $@
 
 DOCMAKE_SGML_PATH = lib/sgml/shlomif-docbook
-DOCBOOK_MAK_MAKEFILES_PATH = lib/make/docbook
+DOCBOOK4_MAK_MAKEFILES_PATH = lib/make/docbook
 
-include $(DOCBOOK_MAK_MAKEFILES_PATH)/docbook-render.mak
+include $(DOCBOOK4_MAK_MAKEFILES_PATH)/docbook-render.mak
 
 DOCMAKE_PARAMS = -v
 
-$(DOCBOOK_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html: $(DOCBOOK_XML_DIR)/%.xml
-	$(DOCMAKE) --stringparam "docmake.output.format=xhtml" -x $(XHTML_ONE_CHUNK_XSLT_SS) -o $(patsubst $(DOCBOOK_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html,$(DOCBOOK_ALL_IN_ONE_XHTML_DIR)/%,$@) xhtml $<
+$(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html: $(DOCBOOK4_XML_DIR)/%.xml
+	$(DOCMAKE) --stringparam "docmake.output.format=xhtml" -x $(XHTML_ONE_CHUNK_XSLT_SS) -o $(patsubst $(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html,$(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%,$@) xhtml $<
 	mv $(patsubst %/all-in-one.html,%/index.html,$@) $@
 
 $(T2_DEST)/humour/TOWTF/TOW_Fountainhead_1.txt: $(SCREENPLAY_XML_TXT_DIR)/TOW_Fountainhead_1.txt
 tidy: all
 	perl bin/run-tidy.pl
 
-.PHONY: install_docbook_pdfs install_docbook_xmls install_docbook_rtfs install_docbook_individual_xhtmls install_docbook_css_dirs
+.PHONY: install_docbook4_pdfs install_docbook_xmls install_docbook4_rtfs install_docbook_individual_xhtmls install_docbook_css_dirs
 
-install_docbook_pdfs: make-dirs $(DOCBOOK_INSTALLED_PDFS)
+install_docbook4_pdfs: make-dirs $(DOCBOOK4_INSTALLED_PDFS)
+install_docbook5_pdfs: make-dirs $(DOCBOOK5_INSTALLED_PDFS)
 
-install_docbook_xmls: make-dirs $(DOCBOOK_INSTALLED_XMLS)
+install_docbook4_xmls: make-dirs $(DOCBOOK4_INSTALLED_XMLS)
+install_docbook5_xmls: make-dirs $(DOCBOOK5_INSTALLED_XMLS)
 
-install_docbook_rtfs: make-dirs  $(DOCBOOK_INSTALLED_RTFS)
+install_docbook4_rtfs: make-dirs  $(DOCBOOK4_INSTALLED_RTFS)
+install_docbook5_rtfs: make-dirs  $(DOCBOOK5_INSTALLED_RTFS)
 
-install_docbook_individual_xhtmls: make-dirs $(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS) $(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS_CSS)
+install_docbook_individual_xhtmls: make-dirs $(DOCBOOK4_INSTALLED_INDIVIDUAL_XHTMLS) $(DOCBOOK4_INSTALLED_INDIVIDUAL_XHTMLS_CSS)
 
-install_docbook_css_dirs: make-dirs $(DOCBOOK_INSTALLED_CSS_DIRS)
+install_docbook_css_dirs: make-dirs $(DOCBOOK4_INSTALLED_CSS_DIRS)
 
 # This copies all the .pdf's at once - not ideal, but still
 # working.
 
-$(DOCBOOK_INSTALLED_CSS_DIRS) : lib/sgml/docbook-css/docbook-css-0.4/
+$(DOCBOOK4_INSTALLED_CSS_DIRS) : lib/sgml/docbook-css/docbook-css-0.4/
 	rsync -r -v $< $@
 	find $@ -name '.svn' -print0 | xargs -0 rm -fr
 
 $(FORTUNES_ATOM_FEED) $(FORTUNES_RSS_FEED): $(T2_FORTUNES_DIR)/generate-web-feeds.pl $(FORTUNES_XMLS_SRC)
 	perl $< --atom $(FORTUNES_ATOM_FEED) --rss $(FORTUNES_RSS_FEED) --dir $(T2_FORTUNES_DIR)
 
-$(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS_CSS): %: $(DOCMAKE_STYLE_CSS)
+$(DOCBOOK4_INSTALLED_INDIVIDUAL_XHTMLS_CSS): %: $(DOCMAKE_STYLE_CSS)
 	cp -f $< $@
 
-$(DOCBOOK_ALL_IN_ONE_XHTMLS_CSS): %: $(DOCMAKE_STYLE_CSS)
+$(DOCBOOK4_ALL_IN_ONE_XHTMLS_CSS): %: $(DOCMAKE_STYLE_CSS)
 	cp -f $< $@
 
 common/style.css.ttml: lib/smoked-wp-theme.css.ttml
 lib/htmls/The-Enemy-English-rev5.html-part: t2/humour/TheEnemy/The-Enemy-English-rev5.xhtml.gz ./bin/extract-xhtml.pl
 	gunzip < $< | perl ./bin/extract-xhtml.pl -o $@ -
 
-DOCBOOK_HHFG_IMAGES_RAW = \
+DOCBOOK4_HHFG_IMAGES_RAW = \
 	background-image.png \
 	background-shlomif.png \
 	bottom-shlomif.png \
 	style.css \
 	top-shlomif.png
 
-DOCBOOK_HHFG_DEST_DIR = $(T2_DEST)/humour/human-hacking/human-hacking-field-guide
-DOCBOOK_HHFG_IMAGES_DEST = $(patsubst %,$(DOCBOOK_HHFG_DEST_DIR)/%,$(DOCBOOK_HHFG_IMAGES_RAW))
+DOCBOOK4_HHFG_DEST_DIR = $(T2_DEST)/humour/human-hacking/human-hacking-field-guide
+DOCBOOK4_HHFG_IMAGES_DEST = $(patsubst %,$(DOCBOOK4_HHFG_DEST_DIR)/%,$(DOCBOOK4_HHFG_IMAGES_RAW))
 
-docbook_hhfg_images: $(DOCBOOK_HHFG_IMAGES_DEST)
+docbook_hhfg_images: $(DOCBOOK4_HHFG_IMAGES_DEST)
 
-$(DOCBOOK_HHFG_IMAGES_DEST): $(DOCBOOK_HHFG_DEST_DIR)/%: $(DOCBOOK_BASE_DIR)/style/human-hacking-field-guide/%
+$(DOCBOOK4_HHFG_IMAGES_DEST): $(DOCBOOK4_HHFG_DEST_DIR)/%: $(DOCBOOK4_BASE_DIR)/style/human-hacking-field-guide/%
 	cp -f $< $@
 
 DOCBOOK5_XSL_STYLESHEETS_PATH := $(HOME)/Download/unpack/file/docbook/docbook-xsl-snapshot
 DOCBOOK5_SOURCES_DIR = $(DOCBOOK5_BASE_DIR)/xml
 DOCBOOK5_FO_DIR = $(DOCBOOK5_BASE_DIR)/fo
 DOCBOOK5_PDF_DIR = $(DOCBOOK5_BASE_DIR)/pdf
+DOCBOOK5_RTF_DIR = $(DOCBOOK5_BASE_DIR)/rtf
 DOCBOOK5_RENDERED_DIR = $(DOCBOOK5_BASE_DIR)/rendered
 
-DOCBOOK5_ALL_IN_ONE_XHTMLS = $(patsubst %,$(DOCBOOK5_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.xhtml,$(DOCBOOK5_DOCS))
-DOCBOOK5_RENDERED_HTMLS = $(patsubst %,$(DOCBOOK5_RENDERED_DIR)/%.xhtml,$(DOCBOOK5_DOCS))
-DOCBOOK5_FOS = $(patsubst %,$(DOCBOOK5_FO_DIR)/%.fo,$(DOCBOOK5_DOCS))
-DOCBOOK5_PDFS = $(patsubst %,$(DOCBOOK5_PDF_DIR)/%.pdf,$(DOCBOOK5_DOCS))
+# DOCBOOK4_BASE_DIR = lib/docbook
+# DOCBOOK4_ALL_IN_ONE_XHTML_DIR = $(DOCBOOK4_BASE_DIR)/essays
+# DOCBOOK4_SOURCES_DIR = $(DOCBOOK4_BASE_DIR)/xml
+# DOCBOOK4_FO_DIR = $(DOCBOOK4_BASE_DIR)/fo
+# DOCBOOK4_PDF_DIR = $(DOCBOOK4_BASE_DIR)/pdf
+# DOCBOOK4_RENDERED_DIR = $(DOCBOOK4_BASE_DIR)/rendered
+
+# DOCBOOK5_ALL_IN_ONE_XHTMLS = $(patsubst %,$(DOCBOOK5_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.xhtml,$(DOCBOOK5_DOCS))
+# DOCBOOK5_RENDERED_HTMLS = $(patsubst %,$(DOCBOOK5_RENDERED_DIR)/%.xhtml,$(DOCBOOK5_DOCS))
+# DOCBOOK5_FOS = $(patsubst %,$(DOCBOOK5_FO_DIR)/%.fo,$(DOCBOOK5_DOCS))
+# DOCBOOK5_PDFS = $(patsubst %,$(DOCBOOK5_PDF_DIR)/%.pdf,$(DOCBOOK5_DOCS))
+# DOCBOOK5_RTFS = $(patsubst %,$(DOCBOOK5_RTF_DIR)/%.pdf,$(DOCBOOK5_DOCS))
 
 docbook5_targets: $(DOCBOOK5_RENDERED_HTMLS) $(DOCBOOK5_FOS)
 
+
+
+
+
+$(DOCBOOK4_RENDERED_DIR)/%.html: $(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html
+	./bin/clean-up-docbook-xsl-xhtml.pl -o $@ $<
+
+$(DOCBOOK4_FO_DIR)/%.fo: $(DOCBOOK4_XML_DIR)/%.xml
+	$(DOCMAKE_WITH_PARAMS) -o $@ --stringparam "docmake.output.format=fo" -x $(FO_XSLT_SS) fo $<
+
+$(DOCBOOK4_PDF_DIR)/%.pdf: $(DOCBOOK4_FO_DIR)/%.fo
+	fop -fo $< -pdf $@
+
+$(DOCBOOK4_RTF_DIR)/%.rtf: $(DOCBOOK4_FO_DIR)/%.fo
+	fop -fo $< -rtf $@
+
+$(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html: $(DOCBOOK4_XML_DIR)/%.xml
+	$(DOCMAKE) --stringparam "docmake.output.format=xhtml" -x $(XHTML_ONE_CHUNK_XSLT_SS) -o $(patsubst $(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.html,$(DOCBOOK4_ALL_IN_ONE_XHTML_DIR)/%,$@) xhtml $<
+	mv $(patsubst %/all-in-one.html,%/index.html,$@) $@
+
+
+
 $(DOCBOOK5_ALL_IN_ONE_XHTMLS): $(DOCBOOK5_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.xhtml: $(DOCBOOK5_SOURCES_DIR)/%.xml
 	jing http://www.docbook.org/xml/5.0/rng/docbook.rng $<
 	xsltproc --path $(DOCBOOK5_XSL_STYLESHEETS_XHTML_PATH) -o $@ $(DOCBOOK5_XSL_CUSTOM_XSLT_STYLESHEET) $<
 
 $(DOCBOOK5_PDF_DIR)/%.pdf: $(DOCBOOK5_FO_DIR)/%.fo
 	fop -fo $< -pdf $@
+
+$(DOCBOOK5_RTF_DIR)/%.rtf: $(DOCBOOK5_FO_DIR)/%.fo
+	fop -fo $< -rtf $@

File bin/gen-docbook-make-helpers.pl

View file
 
 use File::Find::Object::Rule;
 
+use List::MoreUtils qw(any);
+
 my @documents =
 (
     {
         path => "philosophy/psychology/hypomanias/", 
         base => "dealing-with-hypomanias",
         work_in_progress => 1,
+        db_ver => 5,
     },
     {
         id => "end-of-it-slavery", 
 
 );
 
+foreach my $d (@documents)
+{
+    if (! exists($d->{db_ver}))
+    {
+        $d->{db_ver} = 4;
+    }
+    elsif (! (any { $d->{db_ver} eq $_ } (4,5)))
+    {
+        die "Illegal db_ver $d->{db_ver}!";
+    }
+}
+
 sub process_simple_end_format
 {
     my $fmt = shift;
 
 $tt->process($template_fh, 
     {
-        docs => \@documents,
+        docs_4 => [ grep { $_->{db_ver} != 5 } @documents],
+        docs_5 => [ grep { $_->{db_ver} == 5 } @documents],
         fmts => \@end_formats,
         top_header => <<"EOF",
 ### This file is auto-generated from gen-dobook-make-helpers.pl
         },
     },
     $make_fh
-);
+) or die $tt->error();
 
 close ($template_fh);
 close ($make_fh);

File lib/make/docbook/sf-homepage-db-gen.tt

View file
 [%- USE String -%]
 [% top_header %]
 
+[% FOREACH db_ver = [4,5] %]
+[% docs = ((db_ver == 4) ? docs_4 : docs_5) %]
+[% db_ver_path = (db_ver == 4 ? "" : (db_ver _ "/")) %]
+[% SET db_macro_prefix = "DOCBOOK" _ db_ver %]
+
 [% FOREACH d = docs %]
-$(call set,DOCBOOK_DIRS_MAP,[% d.base %],[% d.path %])
+$(call set,[% db_macro_prefix %]_DIRS_MAP,[% d.base %],[% d.path %])
 [% END %]
 
-DOCBOOK_DOCS = [% FOREACH d = docs %][% d.base %] [% END %]
+[% db_macro_prefix %]_DOCS = [% FOREACH d = docs %][% d.base %] [% END %]
 
 [% FOREACH fmt = fmts %]
-DOCBOOK_INSTALLED_[% fmt.var %]S = [% FOREACH d = docs %]$(T2_DEST)/[% d.path %]/[% d.base %][% fmt.ext %] [% END %]
+[% db_macro_prefix %]_INSTALLED_[% fmt.var %]S = [% FOREACH d = docs %]$(T2_DEST)/[% d.path %]/[% d.base %][% fmt.ext %] [% END %]
 
-DOCBOOK_[% fmt.var %]_DIR = lib/docbook/[% fmt.dir %]
+[% db_macro_prefix %]_[% fmt.var %]_DIR = lib/docbook/[% db_ver_path %][% fmt.dir %]
 
 [% END %]
 
 # The individual docs.
 [% FOREACH d = docs %]
 
-$(T2_DEST)/[% d. path %]/[% d.base %].pdf: $(DOCBOOK_PDF_DIR)/[% d.base %].pdf
+$(T2_DEST)/[% d. path %]/[% d.base %].pdf: $([% db_macro_prefix %]_PDF_DIR)/[% d.base %].pdf
 [% "\t" %]cp -f $< $@
 
-$(T2_DEST)/[% d. path %]/[% d.base %].xml: $(DOCBOOK_XML_DIR)/[% d.base %].xml
+$(T2_DEST)/[% d. path %]/[% d.base %].xml: $([% db_macro_prefix %]_XML_DIR)/[% d.base %].xml
 [% "\t" %]cp -f $< $@
 
-$(T2_DEST)/[% d. path %]/[% d.base %].rtf: $(DOCBOOK_RTF_DIR)/[% d.base %].rtf
+$(T2_DEST)/[% d. path %]/[% d.base %].rtf: $([% db_macro_prefix %]_RTF_DIR)/[% d.base %].rtf
 [% "\t" %]cp -f $< $@
 
-$(T2_DEST)/[% d.path %]/[% d.base %]: $(DOCBOOK_INDIVIDUAL_XHTML_DIR)/[% d.base %]
-[% "\t" %]rsync -r -v $(DOCBOOK_INDIVIDUAL_XHTML_DIR)/$(notdir $@) $(dir $@)
+$(T2_DEST)/[% d.path %]/[% d.base %]: $([% db_macro_prefix %]_INDIVIDUAL_XHTML_DIR)/[% d.base %]
+[% "\t" %]rsync -r -v $([% db_macro_prefix %]_INDIVIDUAL_XHTML_DIR)/$(notdir $@) $(dir $@)
 
-$(DOCBOOK_INDIVIDUAL_XHTML_DIR)/[% d.base %]: $(DOCBOOK_XML_DIR)/[% d.base %].xml $(XSL_SOURCES)
+$([% db_macro_prefix %]_INDIVIDUAL_XHTML_DIR)/[% d.base %]: $([% db_macro_prefix %]_XML_DIR)/[% d.base %].xml $(XSL_SOURCES)
 [% "\t" %]$(DOCMAKE_WITH_PARAMS) \
 [% "\t\t" %]--stringparam "docmake.output.format=xhtml" \
 [% "\t\t" %]--stringparam "docmake.output.path_to_root=[% "../../" %]" \
 
 [% END %]
 
+[% END # db_ver loop.
+%]
+
 [% SET pres_targets = [] %]
 
 [% # The Perl-for-Newbies files handling.