3 # Searches through the whole source tree and updates
4 # the generated *.gen/*.mod files in the docs folder, keeping all
5 # documentation for the tools, builders and functions...
6 # as well as the entity declarations for them.
7 # Uses scons-proc.py under the hood...
15 # Directory where all generated files are stored
16 gen_folder
= os
.path
.join('doc', 'generated')
19 """ Return the argument pair *.gen,*.mod for the given key. """
21 os
.path
.join(gen_folder
, '%s.gen' % key
),
22 os
.path
.join(gen_folder
, '%s.mod' % key
),
28 """Generate the entity files.
30 Scan for XML files in the SCons directory and call scons-proc.py
31 to generate the *.gen/*.mod files from it.
34 for path
, dirs
, files
in os
.walk('SCons'):
36 if f
.endswith('.xml'):
37 fpath
= os
.path
.join(path
, f
)
38 if SConsDoc
.isSConsXml(fpath
):
42 # Does the destination folder exist
44 os
.makedirs(gen_folder
, exist_ok
=True)
46 print("Couldn't create destination folder %s! Exiting..." % gen_folder
, file=sys
.stdout
)
53 os
.path
.join('bin', 'scons-proc.py'),
54 '-b', argpair('builders'),
55 '-f', argpair('functions'),
56 '-t', argpair('tools'),
57 '-v', argpair('variables'),
63 print("Generation failed", file=sys
.stderr
)
68 if __name__
== "__main__":
69 if not generate_all():