9ef20a073359a11d0a5e6c91b35c88952c7248be
[senf.git] / Examples / SConscript
1 # -*- python -*-
2
3 Import('env')
4 import SENFSCons, glob
5
6 ###########################################################################
7
8 SENFSCons.IndexPage(env, 'Mainpage.dox', title="Examples")
9
10 SENFSCons.Doxygen(env)
11
12 for sconstruct in glob.glob("*/SConstruct"):
13     dir=env.File(sconstruct).dir
14     example=env.Command(dir.File('.example.phony'), env.Alias('default'),
15                         [ '$SCONS -C $EXAMPLEDIR' ],
16                         CONCURRENCY_LEVEL=1, EXAMPLEDIR=dir)
17     env.Alias('examples', example)
18     if env.GetOption('clean') and ('all' in BUILD_TARGETS or 'examples' in BUILD_TARGETS):
19         env.Clone(CONCURRENCY_LEVEL=1, EXAMPLEDIR=dir).Execute([ '$SCONS -C $EXAMPLEDIR -c' ])
20                     
21
22 for dox in glob.glob("*/Doxyfile"):
23     extra_sources = [ eval(line.split(':',1)[1])
24                       for line in file(dox) 
25                       if line.startswith("# extra_source: ") ]
26     SENFSCons.Doxygen(env, doxyfile=dox, extra_sources=extra_sources)