Buildsystem updates
[senf.git] / senf / Ext / SConscript
index 90dcbc4..1a6d41f 100644 (file)
@@ -7,40 +7,14 @@ import SENFSCons, glob, os.path, yaptu
 
 sconscripts = sorted(glob.glob("*/SConscript"))
 
-EXTENSIONS = []
-for script in sconscripts:
-    name = os.path.split(script)[0]
-    dox = os.path.join(name, 'Mainpage.dox')
-    title = ''
-    if os.path.exists(dox):
-        title = ([''] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
-                            if '\\mainpage' in line ])[-1]
-    EXTENSIONS.append((name, title))
-        
+if sconscripts:
+    SENFSCons.IndexPage(env, 'Mainpage.dox', title="Extensions",
+                        text="""This folder contains additional SENF extensions which are built
+                                into the senf libarary but are not part of senf proper.""")
 
-MAINPAGE="""
-/** \mainpage Extensions
+    SConscript(sconscripts)
 
-    This folder contains additional SENF extensions which are built
-    into the senf libarary but are not part of senf proper.
+    env.Clean('all','Mainpage.dox')
+    env.Clean('all_docs','Mainpage.dox')
 
-    \htmlonly
-    <dl>
-
-{{  for name, title in EXTENSIONS:
-      <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
-}}
-
-    </dl>
-    \endhtmlonly
- */
-"""
-
-file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
-
-SConscript(sconscripts)
-
-env.Clean('all','Mainpage.dox')
-env.Clean('all_docs','Mainpage.dox')
-
-SENFSCons.Doxygen(env)
+    SENFSCons.Doxygen(env)