midori/docs/api/wscript_build

39 lines
1.6 KiB
Text
Raw Normal View History

#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
import pproc as subprocess
import os
import Utils
2012-04-05 21:47:48 +00:00
blddir = '_build' # recognized by ack
for module in ('midori', 'katze'):
try:
2012-04-05 21:47:48 +00:00
if not os.access (blddir, os.F_OK):
Utils.check_dir (blddir)
if not os.access (blddir + '/docs', os.F_OK):
Utils.check_dir (blddir + '/docs')
if not os.access (blddir + '/docs/api', os.F_OK):
Utils.check_dir (blddir + '/docs/api')
subprocess.call (['gtkdoc-scan', '--module=' + module,
2012-04-05 21:47:48 +00:00
'--source-dir=' + module, '--output-dir=' + blddir + '/docs/api/' + module,
'--rebuild-sections', '--rebuild-types'])
2012-04-05 21:47:48 +00:00
os.chdir (blddir + '/docs/api/' + module)
subprocess.call (['gtkdoc-mktmpl', '--module=' + module,
'--output-dir=.' + module])
subprocess.call (['gtkdoc-mkdb', '--module=' + module,
'--source-dir=.', '--output-dir=xml',
'--source-suffixes=c,h', '--output-format=xml',
'--default-includes=%s/%s.h' % (module, module),
'--sgml-mode', '--main-sgml-file=%s.sgml' % module])
if not os.access ('html', os.F_OK):
Utils.check_dir ('html')
os.chdir ('html')
subprocess.call (['gtkdoc-mkhtml', module, '../%s.sgml' % module])
2009-03-23 11:08:27 +00:00
Utils.pprint ('YELLOW', "Created documentation for %s." % module)
os.chdir ('../../../../..')
except Exception, msg:
print msg
2009-03-23 11:08:27 +00:00
Utils.pprint ('RED', "Failed to create documentation for %s." % module)