]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/docca/example/Jamfile
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / tools / docca / example / Jamfile
1 #
2 # Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 #
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)
6 #
7 # Official repository: https://github.com/cppalliance/json
8 #
9
10 project json/doc ;
11
12 import os ;
13 import path ;
14 import boostbook ;
15 import quickbook ;
16 import xsltproc ;
17 import doxygen ;
18 import modules ;
19 import saxonhe ;
20
21 path-constant out : . ;
22
23 #-------------------------------------------------------------------------------
24 #
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.
28 #
29
30 local sources = [ path.glob-tree ../include/boost/json : *.hpp *.ipp : detail impl ] ;
31
32 # Get the configured paths to doxygen and xsltproc
33
34 .doxygen = [ doxygen.name ] ;
35 .doxygen ?= doxygen ;
36
37 .xsltproc = [ xsltproc.name ] ;
38 .xsltproc ?= xsltproc ;
39
40 #-------------------------------------------------------------------------------
41 #
42 # Invoke Doxygen to process the header files and produce the XML
43 # containing the description of the C++ declarations and extracted
44 # Javadoc comments.
45 #
46 make index.xml
47 :
48 ./source.dox
49 :
50 @make_doxygen_xml
51 :
52 <dependency>$(sources)
53 ;
54
55 rule make_doxygen_xml ( targets * : sources * : properties * )
56 {
57 EXAMPLE_DIR on $(targets) =
58 [ path.native [ path.root
59 [ on $(sources[1]) return $(SEARCH) ] [ path.pwd ] ] ] ;
60 }
61
62 if [ os.name ] = NT
63 {
64 actions make_doxygen_xml
65 {
66 SET EXAMPLE_DIR=$(EXAMPLE_DIR)
67 SET XML_OUTPUT=$(1:D)
68 "$(.doxygen)" $(2)
69 }
70 }
71 else
72 {
73 actions make_doxygen_xml
74 {
75 export EXAMPLE_DIR=$(EXAMPLE_DIR)
76 export XML_OUTPUT=$(1:D)
77 "$(.doxygen)" $(2)
78 }
79 }
80
81 #-------------------------------------------------------------------------------
82 #
83 # Copy all the XSLT modules to the target directory.
84 #
85 # FIXME: Change this so we can just specify a directory,
86 # rather than every file individually.
87 #
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.
94 #
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 ;
104
105 make config.xsl
106 :
107 $(docca)/include/docca/config.xsl
108 xsl/config.xsl
109 xsl/class_detail.xsl
110 xsl/includes.xsl
111 :
112 @make_config
113 ;
114
115 actions make_config
116 {
117 cp $(2[1]) $(1)
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)
120 }
121
122 # Make a copy of the given file.
123 #
124 actions copy_script
125 {
126 cp $(2[1]) $(1)
127 }
128
129
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 ;
132
133 #-------------------------------------------------------------------------------
134 #
135 # Run index.xml through the first transformation stage
136 # (assembling and splitting the XML into page-specific files).
137 #
138 make xml-pages.xml
139 :
140 index.xml
141 extract-xml-pages.xsl
142
143 # Make bjam aware of additional dependencies
144 base-extract-xml-pages.xsl
145 config.xsl
146 common.xsl
147 :
148 saxonhe.saxonhe
149 ;
150
151 # This is just to make the directory eligible as a source
152 make xml-pages : index.xml : @null_action ;
153
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
156 # :
157 # stage1.xsl
158 # xslt-visualizer/xsl/trace-enable.xsl
159 # :
160 # saxonhe.saxonhe
161 # ;
162
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 ;
166
167 # TODO: figure out why this (and the following stage) get built every time
168 make stage1/results
169 :
170 xml-pages
171 stage1.xsl
172
173 # additional dependencies
174 xml-pages.xml
175 base-stage1.xsl
176 config.xsl
177 common.xsl
178 :
179 saxonhe.saxonhe_dir
180 ;
181
182 make stage2/results
183 :
184 stage1/results
185 stage2.xsl
186
187 # additional dependencies
188 emphasized-types.xsl
189 :
190 saxonhe.saxonhe_dir
191 ;
192
193 make reference.qbk
194 :
195 xml-pages.xml
196 assemble-quickbook.xsl
197
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!)
201 stage2/results
202 :
203 saxonhe.saxonhe
204 ;
205
206 actions make_dir
207 {
208 mkdir $(1)
209 }
210
211 make combine.xslt : index.xml : @null_action ;
212
213 actions touch_file
214 {
215 touch $(1) ;
216 }
217
218 actions null_action
219 {
220 touch -c $(1) ;
221 }
222
223 make reference.xml
224 :
225 combine.xslt
226 index.xml
227 :
228 @call-xsltproc
229 ;
230
231 actions call-xsltproc
232 {
233 "$(.xsltproc)" $(2) > $(1)
234 }
235
236 #-------------------------------------------------------------------------------
237 #
238 # Produce the reference.qbk file by running
239 # the reference xml through the transform.
240 #
241 #make reference.qbk
242 # :
243 # reference.xml
244 # transform.xsl
245 # :
246 # saxonhe.saxonhe
247 # ;
248
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
251 #
252 install qbk : reference.qbk ;
253
254 #-------------------------------------------------------------------------------
255 #
256 # Produce the Boost.Book XML from the QuickBook
257 #
258
259 install images
260 :
261 [ glob images/*.png ]
262 :
263 <location>html/json/images
264 ;
265
266 explicit images ;
267
268 xml json_doc
269 :
270 main.qbk
271 :
272 <dependency>images
273 <dependency>qbk
274 ;
275
276 explicit json_doc ;
277
278 #-------------------------------------------------------------------------------
279 #
280 # HTML documentation for $(BOOST_ROOT)/doc/html
281 #
282 #-------------------------------------------------------------------------------
283
284 boostbook json
285 :
286 json_doc
287 :
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
297 :
298 <dependency>images
299 ;
300
301 #-------------------------------------------------------------------------------
302 #
303 # These are used to inform the build system of the
304 # means to build the integrated and stand-alone docs.
305 #
306
307 alias boostdoc ;
308 explicit boostdoc ;
309
310 alias boostrelease : json ;
311 explicit boostrelease ;