2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 12:22:17 +00:00
Files
build/doxygen.jam
2003-03-27 18:43:18 +00:00

116 lines
3.3 KiB
Plaintext

# Copyright (C) 2003 Doug Gregor. Permission to copy, use, modify,
# sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.
# This module defines rules to handle generation of BoostBook XML
# from Doxygen XML output. At the moment, this requires a special
# version of Doxygen that can output a single XML file instead of a
# set of XML files.
import class : class new ;
import targets ;
import feature ;
import property ;
import generators ;
import boostbook ;
feature.feature recursive : off on ;
feature.feature pattern : : free ;
type.register DOXYGEN_XML : doxygen ; # Doxygen XML output
generators.register-standard doxygen.xml-to-boostbook : DOXYGEN_XML : XML ;
# Initialize the Doxygen module. Parameters are:
# name: the name of the 'doxygen' executable. If not specified, the name
# 'doxygen' will be used
rule init ( name ? )
{
if ! $(.initialized)
{
.initialized = true ;
if $(name)
{
.doxygen = $(name) ;
}
}
}
rule name ( )
{
return $(.doxygen) ;
}
rule extract-xml ( target : sources * : properties * )
{
local recursive = [ feature.get-values <recursive> : $(properties) ] ;
if $(recursive) = "on"
{
RECURSIVE on $(target) = YES ;
}
else
{
RECURSIVE on $(target) = NO ;
}
PATTERNS on $(target) = [ feature.get-values <pattern> : $(properties) ] ;
NAME on $(target) = [ name ] ;
doxygen-action $(<) : $(>) ;
}
actions doxygen-action
{
$(NAME:E=doxygen) -g $(<:S=.doxyfile)
echo "GENERATE_HTML = NO" >> $(<:S=.doxyfile)
echo "GENERATE_LATEX = NO" >> $(<:S=.doxyfile)
echo "GENERATE_XML = YES" >> $(<:S=.doxyfile)
echo "INPUT = $(>) " >> $(<:S=.doxyfile)
echo "MONOLITHIC_XML_FILE = $(<)" >> $(<:S=.doxyfile)
echo "RECURSIVE = $(RECURSIVE) " >> $(<:S=.doxyfile)
echo "FILE_PATTERNS = $(PATTERNS) " >> $(<:S=.doxyfile)
$(NAME:E=doxygen) $(<:S=.doxyfile) ;
}
rule xml-to-boostbook ( target : source : properties * )
{
local xsl-dir = [ boostbook.xsl-dir ] ;
boostbook.xslt $(target)
: $(source) "$(xsl-dir)/doxygen/doxygen2boostbook.xsl"
: $(properties)
;
}
rule doxygen-xml-target-class ( name : project : sources * : requirements *
: default-build * )
{
basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements)
: $(default-build) ;
rule construct ( source-targets * : property-set )
{
local target =
[ virtual-target.from-file $(self.name) : $(self.project) ] ;
local a = [ new action $(target) : $(source-targets) : doxygen.extract-xml
: $(property-set) ] ;
$(target).action $(a) ;
return [ virtual-target.register $(target) ] ;
}
}
class doxygen-xml-target-class : basic-target ;
rule doxygen ( target-name : sources * : requirements * : default-build * )
{
local project = [ CALLER_MODULE ] ;
targets.main-target-alternative
[ new doxygen-xml-target-class $(target-name) : $(project) : $(sources)
: [ targets.main-target-requirements $(requirements) : $(project) ]
: [ targets.main-target-default-build $(default-build) : $(project) ]
] ;
}