X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Examples%2FSConscript;h=7350f38268d1efecc40ea74cead3e2657ca47cec;hb=0f4295ebd0f45ccbaa0c3d9a4d480245bf08c3c1;hp=c5e6c01ad27add5fcf7dfbda01ce2118f75a1881;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git
diff --git a/Examples/SConscript b/Examples/SConscript
index c5e6c01..7350f38 100644
--- a/Examples/SConscript
+++ b/Examples/SConscript
@@ -1,37 +1,26 @@
# -*- python -*-
Import('env')
-import SENFSCons, glob, yaptu
+import SENFSCons, glob
###########################################################################
-EXAMPLES = []
-for dox in sorted(glob.glob("*/Mainpage.dox")):
- title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
- if '\\mainpage' in line ])[-1]
- if title:
- EXAMPLES.append( (dox.split('/',1)[0], title) )
-
-MAINPAGE="""
-/** \mainpage Examples
-
- \htmlonly
-
-
-{{ for name, title in EXAMPLES:
- - ${name}
- ${title}
-}}
-
-
- \endhtmlonly
- */
-"""
-
-file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
-
-SConscript(glob.glob("*/SConscript"))
-
-env.Clean('all','Mainpage.dox')
-env.Clean('all_docs','Mainpage.dox')
+SENFSCons.IndexPage(env, 'Mainpage.dox', title="Examples")
SENFSCons.Doxygen(env)
+
+for sconstruct in glob.glob("*/SConstruct"):
+ dir=env.File(sconstruct).dir
+ example=env.Command(dir.File('.example.phony'), env.Alias('default'),
+ [ '$SCONS -C $EXAMPLEDIR' ],
+ CONCURRENCY_LEVEL=1, EXAMPLEDIR=dir)
+ env.Alias('examples', example)
+ if env.GetOption('clean') and 'all' in BUILD_TARGETS or 'examples' in BUILD_TARGETS:
+ env.Clone(CONCURRENCY_LEVEL=1, EXAMPLEDIR=dir).Execute([ '$SCONS -C $EXAMPLEDIR -c' ])
+
+
+for dox in glob.glob("*/Doxyfile"):
+ extra_sources = [ eval(line.split(':',1)[1])
+ for line in file(dox)
+ if line.startswith("# extra_source: ") ]
+ SENFSCons.Doxygen(env, doxyfile=dox, extra_sources=extra_sources)