summaryrefslogtreecommitdiffstats
path: root/autowaf.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-09 08:10:31 +0000
committerDavid Robillard <d@drobilla.net>2012-07-09 08:10:31 +0000
commita3a7096336a3428e439dae3a539cb5bd33fef7a7 (patch)
tree8cad96071bca93154be4acd9a9bbc480be5f9602 /autowaf.py
parent3407d0abe6ac75c8cf57734da64b482d9ef11b75 (diff)
downloadautowaf-a3a7096336a3428e439dae3a539cb5bd33fef7a7.tar.gz
autowaf-a3a7096336a3428e439dae3a539cb5bd33fef7a7.tar.bz2
autowaf-a3a7096336a3428e439dae3a539cb5bd33fef7a7.zip
Add autowawf.build_dir() for getting build dir in top-level and child cases.
Add autowaf.make_simple_dox() for making clean single-page documentation out of the mess Doxygen gives us. Don't install weird directory reference man pages with mangled absolute path names generated by Doxygen. git-svn-id: http://svn.drobilla.net/autowaf@70 e2e4594f-ea7b-45dc-bc5a-5f5301e603aa
Diffstat (limited to 'autowaf.py')
-rw-r--r--autowaf.py51
1 files changed, 47 insertions, 4 deletions
diff --git a/autowaf.py b/autowaf.py
index 5120f3f..4031af6 100644
--- a/autowaf.py
+++ b/autowaf.py
@@ -353,6 +353,49 @@ def build_pc(bld, name, version, version_suffix, libs, subst_dict={}):
obj.__dict__.update(subst_dict)
+def build_dir(name, subdir):
+ if is_child():
+ return os.path.join('build', name, subdir)
+ else:
+ return os.path.join('build', subdir)
+
+# Clean up messy Doxygen documentation after it is built
+def make_simple_dox(name):
+ name = name.lower()
+ NAME = name.upper()
+ try:
+ top = os.getcwd()
+ os.chdir(build_dir(name, 'doc/html'))
+ page = 'group__%s.html' % name
+ if not os.path.exists(page):
+ return
+ for i in [
+ ['%s_API ' % NAME, ''],
+ ['group__%s.html' % name, ''],
+ ['&#160;', ''],
+ ['<script.*><\/script>', ''],
+ ['<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text\/css\"\/>',
+ ''],
+ ['<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"\/>',
+ 'Doxygen']]:
+ os.system("sed -i 's/%s/%s/g' %s" % (i[0], i[1], page))
+ os.rename('group__%s.html' % name, 'index.html')
+ for i in (glob.glob('*.png') +
+ glob.glob('*.html') +
+ glob.glob('*.js') +
+ glob.glob('*.css')):
+ if i != 'index.html' and i != 'style.css':
+ os.remove(i)
+ os.chdir(top)
+ os.chdir(build_dir(name, 'doc/man/man3'))
+ for i in glob.glob('*.3'):
+ os.system("sed -i 's/%s_API //' %s" % (NAME, i))
+ for i in glob.glob('_*'):
+ os.remove(i)
+ os.chdir(top)
+ except Exception as e:
+ Logs.error("Failed to fix up %s documentation: %s" % (name, e))
+
# Doxygen API documentation
def build_dox(bld, name, version, srcdir, blddir):
if not bld.env['DOCS']:
@@ -388,10 +431,10 @@ def build_dox(bld, name, version, srcdir, blddir):
bld.install_files('${DOCDIR}/%s/html' % name.lower(),
bld.path.get_bld().ant_glob('doc/html/*'))
- bld.install_files('${MANDIR}/man1',
- bld.path.get_bld().ant_glob('doc/man/man1/*'))
- bld.install_files('${MANDIR}/man3',
- bld.path.get_bld().ant_glob('doc/man/man3/*'))
+ for i in range(1, 8):
+ bld.install_files('${MANDIR}/man%d' % i,
+ bld.path.get_bld().ant_glob('doc/man/man%d/*' % i,
+ excl='**/_*'))
# Version code file generation
def build_version_files(header_path, source_path, domain, major, minor, micro):