2005-10-29 20:27:43 +04:00
|
|
|
rule Man2Doc
|
|
|
|
{
|
|
|
|
local source = [ FGristFiles $(2) ] ;
|
|
|
|
local binary = $(1) ;
|
|
|
|
|
|
|
|
SEARCH on $(source) = $(SEARCH_SOURCE) ;
|
|
|
|
|
|
|
|
MakeLocate $(binary)
|
|
|
|
: [ FDirName $(HAIKU_DOCUMENTATION_OBJECT_DIR) Shell_Tools ] ;
|
|
|
|
|
|
|
|
Depends $(binary) : $(source) rman ;
|
|
|
|
|
|
|
|
LocalDepends doc_files : $(binary) ;
|
|
|
|
Man2Doc1 $(binary) : rman $(source) ;
|
|
|
|
LocalClean clean : $(binary) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions Man2Doc1
|
|
|
|
{
|
|
|
|
$(2[1]) -f XML "$(2[2])" > "$(1)" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Man2Docs
|
|
|
|
{
|
|
|
|
# Man2Docs <sources> ;
|
|
|
|
local source ;
|
|
|
|
for source in [ FGristFiles $(1) ]
|
|
|
|
{
|
|
|
|
local target = $(source:S=.xml) ;
|
|
|
|
|
|
|
|
Man2Doc $(target) : $(source) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Doc2HTML
|
|
|
|
{
|
|
|
|
local source = [ FGristFiles $(1) ] ;
|
2006-02-21 17:26:25 +03:00
|
|
|
local target = [ FGristFiles $(2) ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
local xslsheet = $(3) ;
|
|
|
|
local basedir = [ FDirName $(HAIKU_DOCUMENTATION_DIR) $(4) ] ;
|
|
|
|
local paths = $(5) ;
|
|
|
|
local options = $(6) ;
|
|
|
|
|
|
|
|
if ! $(target) {
|
|
|
|
target = $(1:S=.html) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
SEARCH on $(source) = $(SEARCH_SOURCE) ;
|
|
|
|
|
|
|
|
MakeLocate $(target) : $(basedir) ;
|
|
|
|
if $(2) {
|
|
|
|
XSLBASEDIR on $(target) = -stringparam base.dir \"$(basedir)/\" ;
|
|
|
|
}
|
|
|
|
XSLSHEET on $(target) = $(xslsheet) ;
|
|
|
|
XSLOPTIONS on $(target) = $(options) ;
|
|
|
|
if $(2) = "" {
|
|
|
|
XSLOUTPUT on $(target) = "-o "\"$(target:D=$(basedir))\" ;
|
|
|
|
}
|
|
|
|
|
2006-09-05 19:52:15 +04:00
|
|
|
XSLCATALOGS on $(target) = \" [ FDirName $(HAIKU_TOP) src documentation docbook-dtd catalog.xml ] [ FDirName $(HAIKU_TOP) src documentation docbook-xsl catalog.xml ] \" ;
|
|
|
|
|
|
|
|
Depends $(target) : $(source) <build>xsltproc ;
|
2005-10-29 20:27:43 +04:00
|
|
|
LocalDepends doc_files : $(target) ;
|
|
|
|
XSLPROCPATHS on $(target) = -path \" $(paths:J=\ ) \" ;
|
2006-09-05 19:52:15 +04:00
|
|
|
Doc2HTML1 $(target) : <build>xsltproc $(source) ;
|
2005-10-29 20:27:43 +04:00
|
|
|
LocalClean clean : $(target) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions Doc2HTML1
|
|
|
|
{
|
2006-09-05 19:52:15 +04:00
|
|
|
$(2[1]) --catalogs $(XSLCATALOGS) -xinclude $(XSLPROCPATHS) $(XSLBASEDIR) $(XSLOPTIONS) $(XSLOUTPUT) $(XSLSHEET) $(2[2-])
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|