X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2FSENFSCons.py;h=01681e4c5c899644dad477bc220d818eda3f6d9e;hb=0cf6e472479e1ac54c061f80a2f1b3b9bc6a84c8;hp=8beeabfa53fcaab0579e1e8c71d205c856a9d99b;hpb=8871644fd9655c9e62384f6f39ce7c0c6c8dcf30;p=senf.git 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' ])