From: g0dil Date: Thu, 4 Feb 2010 21:16:15 +0000 (+0000) Subject: Add SENFSCons.BuildExample helper X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=0cf6e472479e1ac54c061f80a2f1b3b9bc6a84c8 Add SENFSCons.BuildExample helper git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1569 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/SConscript b/Examples/SConscript index 9ef20a0..0709523 100644 --- a/Examples/SConscript +++ b/Examples/SConscript @@ -10,14 +10,7 @@ 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' ]) - + SENFSCons.BuildExample(env, sconstruct) for dox in glob.glob("*/Doxyfile"): extra_sources = [ eval(line.split(':',1)[1]) diff --git a/site_scons/SENFSCons.py b/site_scons/SENFSCons.py index 8beeabf..01681e4 100644 --- a/site_scons/SENFSCons.py +++ b/site_scons/SENFSCons.py @@ -179,3 +179,14 @@ def AutoPacketBundle(env, name, exclude=[], subdirs=[], doc_extra_sources=[]): if includes : env.InstallSubdir('$INCLUDEINSTALLDIR', includes) if doxyfile : SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)) ) if subscripts : SConscript(subscripts) + + +def BuildExample(env, 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' ])