Commits

Anonymous committed c51fcf6

r5907@telaviv1: shlomi | 2008-07-22 15:34:36 +0300
Added more perlification of the DocBook/XML building.

Comments (0)

Files changed (3)

 
 include lib/make/docbook/sf-homepage-docbooks-generated.mak
 
-DOCBOOK_DOCS = $(call keys,DOCBOOK_DIRS_MAP)
-
 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)
 DOCMAKE_STYLE_CSS = $(DOCMAKE_XSLT_PATH)/style.css
 
-# DOCBOOK_DOCS = \
-# 	case-for-drug-legalisation \
-# 	case-for-file-swapping-rev3 \
-# 	end-of-it-slavery \
-# 	introductory-language \
-# 	objectivism-and-open-source \
-# 	what-makes-software-high-quality
-
-#   Removing, because we no longer need to build the DocBook.
-#   $(SCREENPLAY_DOCS)
-
 DOCBOOK_RENDERED_DIR = lib/docbook/rendered
-DOCBOOK_INDIVIDUAL_XHTML_DIR = lib/docbook/indiv-nodes
 DOCBOOK_ALL_IN_ONE_XHTML_DIR = lib/docbook/essays
 
 SCREENPLAY_XML_BASE_DIR = lib/screenplay-xml
 
 # This copies all the .pdf's at once - not ideal, but still
 # working.
-$(DOCBOOK_INSTALLED_PDFS) : $(DOCBOOK_PDFS)
-	cp -f $(DOCBOOK_PDF_DIR)/$(notdir $@) $@
-
-$(DOCBOOK_INSTALLED_XMLS) : $(DOCBOOK_XMLS)
-	cp -f $(DOCBOOK_XML_DIR)/$(notdir $@) $@
-
-$(DOCBOOK_INSTALLED_RTFS) : $(DOCBOOK_RTFS)
-	cp -f $(DOCBOOK_RTF_DIR)/$(notdir $@) $@
-
-$(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS) : $(DOCBOOK_INDIVIDUAL_XHTMLS) $(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS_CSS)
-	rsync -r -v $(DOCBOOK_INDIVIDUAL_XHTML_DIR)/$(notdir $@) $(dir $@)
 
 $(DOCBOOK_INSTALLED_CSS_DIRS) : lib/sgml/docbook-css/docbook-css-0.4/
 	rsync -r -v $< $@
 
 $(DOCBOOK_INSTALLED_INDIVIDUAL_XHTMLS_CSS):: %: $(DOCMAKE_STYLE_CSS)
 	cp -f $< $@
+

bin/gen-docbook-make-helpers.pl

 
     my %f = %$fmt;
 
-    $f{dir} = lc($f{var});
+    if (!exists($f{dir}))
+    {
+        $f{dir} = lc($f{var});
+    }
 
     return \%f;
 }
             skip_install => 1,
         },
         {
-            var => "INVIDIVIDUAL_XHTML",
+            var => "INDIVIDUAL_XHTML",
             ext => "",
+            dir => "indiv-nodes",
         },
         )
     )

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

 $(call set,DOCBOOK_DIRS_MAP,[% d.base %],[% d.path %])
 [% END %]
 
+DOCBOOK_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 %]
 
 DOCBOOK_[% fmt.var %]_DIR = lib/docbook/[% fmt.dir %]
+
 [% END %]
+
+# The individual docs.
+[% FOREACH d = docs %]
+
+$(T2_DEST)/[% d. path %]/[% d.base %].pdf: $(DOCBOOK_PDF_DIR)/[% d.base %].pdf
+[% "\t" %]cp -f $< $@
+
+$(T2_DEST)/[% d. path %]/[% d.base %].xml: $(DOCBOOK_XML_DIR)/[% d.base %].xml
+[% "\t" %]cp -f $< $@
+
+$(T2_DEST)/[% d. path %]/[% d.base %].rtf: $(DOCBOOK_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 $@)
+
+[% END %]