source: rtems-docs/wscript @ 87e1929

Last change on this file since 87e1929 was 0263581, checked in by Chris Johns <chrisj@…>, on Mar 26, 2017 at 11:27:29 PM

waf: Fix linkcheck and spell commands.

Clean up and remove code that is not needed.

Fix sphinx-build quoting to work on Windows.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1#
2# RTEMS Project Documentation
3#
4
5from sys import path
6from os.path import abspath
7path.append(abspath('common'))
8
9import waflib
10import waf as docs_waf
11
12version = '4.11.99 (master)'
13
14build_all = ['user',
15             'rsb',
16             'c-user',
17             'bsp-howto',
18             'posix-users',
19             'filesystem',
20             'networking',
21             'shell',
22             'cpu-supplement',
23             'develenv',
24             'eclipse']
25
26building = build_all
27
28def options(opt):
29    docs_waf.cmd_options(opt)
30
31def configure(conf):
32    conf.env.VERSION = version
33    for b in building:
34        conf.recurse(b)
35    conf.env['BUILD_FROM_TOP'] = 'yes'
36
37def catalogue(ctx):
38    docs_waf.xml_catalogue(ctx, building)
39
40def coverpage_js(ctx):
41    js = None
42    xml = None
43    for f in ctx.inputs:
44        if f.abspath().endswith('.js'):
45            with open(f.abspath()) as i:
46                js = i.read()
47        elif f.abspath().endswith('.xml'):
48            with open(f.abspath()) as i:
49                xml = i.read()
50    xml = xml.replace('\n', ' \\\n');
51    with open(ctx.outputs[0].abspath(), 'w') as o:
52        o.write(js.replace('@CATALOGUE', xml))
53
54def build(ctx):
55    for b in building:
56        ctx.recurse(b)
57
58    #
59    # Build the catalogue, coverpage.js and install.
60    #
61    ctx(rule = catalogue,
62        target = 'catalogue.xml',
63        source = ['wscript', 'common/waf.py'] + ['%s/conf.py' % x for x in building])
64    ctx.install_files('${PREFIX}', 'catalogue.xml')
65    ctx(rule = coverpage_js,
66        target = 'coverpage.js',
67        source = ['wscript', 'catalogue.xml', 'common/coverpage/coverpage.js'])
68    ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js')
69    #
70    # Install the static content.
71    #
72    ctx.install_as('${PREFIX}/index.html', 'common/coverpage/coverpage.html')
73    static_dir = ctx.path.find_dir('common/coverpage/static')
74    ctx.install_files('${PREFIX}/static',
75                      static_dir.ant_glob('**'),
76                      cwd = static_dir,
77                      relative_trick = True)
78
79def install(ctx):
80    for b in building:
81        ctx.recurse(b)
82
83def cmd_spell(ctx):
84    for b in building:
85        ctx.recurse(b)
86
87def cmd_linkcheck(ctx):
88    for b in building:
89        ctx.recurse(b)
Note: See TracBrowser for help on using the repository browser.