ccfed8f284bc30213ffb8f18bee0475ca35b4c2c
[senf.git] / senf / Ext / SConscript
1 # -*- python -*-
2
3 Import('env')
4 import SENFSCons, glob, os.path, yaptu
5
6 ###########################################################################
7
8 sconscripts = sorted(glob.glob("*/SConscript"))
9
10 if sconscripts:
11     EXTENSIONS = []
12     for script in sconscripts:
13         name = os.path.split(script)[0]
14         dox = os.path.join(name, 'Mainpage.dox')
15         title = ''
16         if os.path.exists(dox):
17             title = ([''] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
18                                 if '\\mainpage' in line ])[-1]
19         EXTENSIONS.append((name, title))
20
21
22     MAINPAGE="""
23     /** \mainpage Extensions
24
25         This folder contains additional SENF extensions which are built
26         into the senf libarary but are not part of senf proper.
27
28         \htmlonly
29         <dl>
30
31 {{      for name, title in EXTENSIONS:
32           <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
33 }}
34
35         </dl>
36         \endhtmlonly
37      */
38     """
39
40     file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
41
42     SConscript(sconscripts)
43
44     env.Clean('all','Mainpage.dox')
45     env.Clean('all_docs','Mainpage.dox')
46
47     SENFSCons.Doxygen(env)