|
22 | 22 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
23 | 23 | sys.path.insert(0, os.path.abspath('..')) |
24 | 24 |
|
25 | | -from repo_util import run_cmd_get_output |
| 25 | +from local_util import run_cmd_get_output, copy_if_modified |
| 26 | + |
| 27 | +builddir = '_build' |
| 28 | +if 'BUILDDIR' in os.environ: |
| 29 | + builddir = os.environ['BUILDDIR'] |
26 | 30 |
|
27 | 31 | # Call Doxygen to get XML files from the header files |
28 | 32 | print "Calling Doxygen to generate latest XML files" |
29 | 33 | os.system("doxygen ../Doxyfile") |
| 34 | +# Doxygen has generated XML files in 'xml' directory. |
| 35 | +# Copy them to 'xml_in', only touching the files which have changed. |
| 36 | +copy_if_modified('xml/', 'xml_in/') |
| 37 | + |
30 | 38 | # Generate 'api_name.inc' files using the XML files by Doxygen |
31 | | -os.system("python ../gen-dxd.py") |
| 39 | +os.system('python ../gen-dxd.py') |
| 40 | + |
32 | 41 | # Generate 'kconfig.inc' file from components' Kconfig files |
33 | | -os.system("python ../gen-kconfig-doc.py > _build/inc/kconfig.inc") |
| 42 | +kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir) |
| 43 | +os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in') |
| 44 | +copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path) |
34 | 45 |
|
35 | 46 | # http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format |
36 | 47 | # |
|
63 | 74 | packetdiag_fontpath = '../_static/DejaVuSans.ttf' |
64 | 75 |
|
65 | 76 | # Breathe extension variables |
66 | | -breathe_projects = { "esp32-idf": "xml/" } |
| 77 | + |
| 78 | +# Doxygen regenerates files in 'xml/' directory every time, |
| 79 | +# but we copy files to 'xml_in/' only when they change, to speed up |
| 80 | +# incremental builds. |
| 81 | +breathe_projects = { "esp32-idf": "xml_in/" } |
67 | 82 | breathe_default_project = "esp32-idf" |
68 | 83 |
|
69 | 84 | # Add any paths that contain templates here, relative to this directory. |
|
0 commit comments