2 # Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
4 # Distributed under the Boost Software License, Version 1.0. (See accompanying
5 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 # Official repository: https://github.com/cppalliance/json
21 path-constant out : . ;
23 #-------------------------------------------------------------------------------
25 # Build the list of header files that Doxygen will scan. We need
26 # this list to inform the build system of the dependencies so the
27 # docs can be rebuild if any of the header files change.
30 local sources = [ path.glob-tree ../include/boost/json : *.hpp *.ipp : detail impl ] ;
32 # Get the configured paths to doxygen and xsltproc
34 .doxygen = [ doxygen.name ] ;
37 .xsltproc = [ xsltproc.name ] ;
38 .xsltproc ?= xsltproc ;
40 #-------------------------------------------------------------------------------
42 # Invoke Doxygen to process the header files and produce the XML
43 # containing the description of the C++ declarations and extracted
52 <dependency>$(sources)
55 rule make_doxygen_xml ( targets * : sources * : properties * )
57 EXAMPLE_DIR on $(targets) =
58 [ path.native [ path.root
59 [ on $(sources[1]) return $(SEARCH) ] [ path.pwd ] ] ] ;
64 actions make_doxygen_xml
66 SET EXAMPLE_DIR=$(EXAMPLE_DIR)
73 actions make_doxygen_xml
75 export EXAMPLE_DIR=$(EXAMPLE_DIR)
76 export XML_OUTPUT=$(1:D)
81 #-------------------------------------------------------------------------------
83 # Copy all the XSLT modules to the target directory.
85 # FIXME: Change this so we can just specify a directory,
86 # rather than every file individually.
88 # Also, somehow force dependencies in a general way
89 # such that the XSLT has to be executed again
90 # if any of the modules change. For example,
91 # if base-extract-xml-pages.xml changes, then
92 # an invocation of extract-xml-pages.xsl (which
93 # imports the former) must be run again.
95 path-constant docca : ../../../tools/docca ;
96 make extract-xml-pages.xsl : $(docca)/include/docca/extract-xml-pages.xsl : @copy_script ;
97 make base-extract-xml-pages.xsl : $(docca)/include/docca/base-extract-xml-pages.xsl : @copy_script ;
98 make common.xsl : $(docca)/include/docca/common.xsl : @copy_script ;
99 make stage1.xsl : $(docca)/include/docca/stage1.xsl : @copy_script ;
100 make base-stage1.xsl : $(docca)/include/docca/base-stage1.xsl : @copy_script ;
101 make stage2.xsl : $(docca)/include/docca/stage2.xsl : @copy_script ;
102 make assemble-quickbook.xsl : $(docca)/include/docca/assemble-quickbook.xsl : @copy_script ;
103 make emphasized-types.xsl : $(docca)/include/docca/emphasized-types.xsl : @copy_script ;
107 $(docca)/include/docca/config.xsl
118 sed -i -e "/<!-- CONFIG_TEMPLATE -->/{r $(2[2])" -e "d}" $(1)
119 sed -i -e "/<!-- INCLUDES_FOOT_TEMPLATE -->/{r $(2[4])" -e "d}" $(1)
122 # Make a copy of the given file.
130 # This is to initially create the directory as a side effect; I'm sure there's a better way...
131 make xml-pages/directory/placeholder : index.xml : @null_action ;
133 #-------------------------------------------------------------------------------
135 # Run index.xml through the first transformation stage
136 # (assembling and splitting the XML into page-specific files).
141 extract-xml-pages.xsl
143 # Make bjam aware of additional dependencies
144 base-extract-xml-pages.xsl
151 # This is just to make the directory eligible as a source
152 make xml-pages : index.xml : @null_action ;
154 # Not ready for prime time until I figure out how to get the xslt-visualizer code in place
155 #make stage1/code-trace-enabled/stage1.xsl
158 # xslt-visualizer/xsl/trace-enable.xsl
163 # This is to initially create the directory as a side effect; I'm sure there's a better way...
164 make stage1/results/directory/placeholder : xml-pages.xml : @null_action ;
165 make stage2/results/directory/placeholder : xml-pages.xml : @null_action ;
167 # TODO: figure out why this (and the following stage) get built every time
173 # additional dependencies
187 # additional dependencies
196 assemble-quickbook.xsl
198 # TODO: make this input to the XSLT somehow
199 # rather than relying on it being hard-coded
200 # in the XSLT (which it is!)
211 make combine.xslt : index.xml : @null_action ;
231 actions call-xsltproc
233 "$(.xsltproc)" $(2) > $(1)
236 #-------------------------------------------------------------------------------
238 # Produce the reference.qbk file by running
239 # the reference xml through the transform.
249 # We have to make a copy of reference.qbk and put it
250 # in a place where the static .qbk files can find it
252 install qbk : reference.qbk ;
254 #-------------------------------------------------------------------------------
256 # Produce the Boost.Book XML from the QuickBook
261 [ glob images/*.png ]
263 <location>html/json/images
278 #-------------------------------------------------------------------------------
280 # HTML documentation for $(BOOST_ROOT)/doc/html
282 #-------------------------------------------------------------------------------
288 <xsl:param>boost.root=../../../..
289 <xsl:param>chapter.autolabel=1
290 <xsl:param>chunk.section.depth=8 # Depth to which sections should be chunked
291 <xsl:param>chunk.first.sections=1 # Chunk the first top-level section?
292 <xsl:param>toc.section.depth=2 # How deep should recursive sections appear in the TOC?
293 <xsl:param>toc.max.depth=8 # How many levels should be created for each TOC?
294 <xsl:param>generate.section.toc.level=8 # Control depth of TOC generation in sections
295 <xsl:param>generate.toc="chapter toc,title section nop reference nop"
296 <include>../../../tools/boostbook/dtd
301 #-------------------------------------------------------------------------------
303 # These are used to inform the build system of the
304 # means to build the integrated and stand-alone docs.
310 alias boostrelease : json ;
311 explicit boostrelease ;