--- /dev/null
+# -*- python -*-
+
+Import('env')
+import SENFSCons
+
+###########################################################################
+
+## Most modules will be built using the auto macros from site_scons/SENFSCons.py
+## (see below). Arguments are:
+## env - The construction environment
+## name - name of target (AutoPacketBundle only)
+## exclude - Files to exclude from the build
+## subdirs - Subdirectories to recurse into
+## doc_extra_sources - Extra source files (images) to build for the documentation
+##
+## If the macros don't do exactly what you want you may either copy the function definition
+## body from site_scons/SENFSCons.py into the SConscript file or add additional targets
+
+## Build a standard library module
+#
+# SENFSCons.AutoRules(env, exclude=[...], subdirs=[...], doc_extra_sources=[...]
+
+## Build a packet bundle
+#
+# SENFSCons.AutoPacketBundle(env, name, exclude=[...], subdirs=[...], doc_extra_sources=[...]
+
+## Build an (additional) executable. Build it as default target (built when calling scons
+## without arguments or with the 'default' argument
+#
+# env.Default(env.Program(name, [ sources...]))
# parameters with their actual value. Parameters are marked with ((name)) )
def AutoRules(env, exclude=[], subdirs=[], doc_extra_sources = []):
- import SENFSCons, glob, os.path
+ import SENFSCons
- sources, tests, includes = SENFSCons.Glob(env, exclude=((exclude)), subdirs=((subdirs)) )
- subscripts = glob.glob("*/SConscript")
+ sources, tests, includes = SENFSCons.Glob(env, exclude=((exclude)), subdirs=((subdirs)) )
+ subscripts = env.Glob("*/SConscript")
+ doxyfile = env.Glob("Doxyfile")
- if sources : env.Append(ALLOBJECTS = env.Object(sources))
- if tests : env.BoostUnitTest('test', tests)
- if includes : env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
- if os.path.exists("Doxyfile") : SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)) )
- if subscripts : SConscript(glob.glob("*/SConscript"))
+ if sources : env.Append(ALLOBJECTS = env.Object(sources))
+ if tests : env.BoostUnitTest('test', tests)
+ if includes : env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
+ if doxyfile : SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)) )
+ if subscripts : SConscript(subscripts)
def AutoPacketBundle(env, name, exclude=[], subdirs=[], doc_extra_sources=[]):
- import SENFSCons, glob, os.path
+ import SENFSCons
- sources, tests, includes = SENFSCons.Glob(env, exclude=((exclude)), subdirs=((subdirs)) )
- subscripts = glob.glob("*/SConscript")
+ sources, tests, includes = SENFSCons.Glob(env, exclude=((exclude)), subdirs=((subdirs)) )
+ subscripts = env.Glob("*/SConscript")
+ doxyfile = env.Glob("Doxyfile")
objects = env.Object(sources)
cobject = env.CombinedObject('${LOCALLIBDIR}/${NAME}${OBJADDSUFFIX}', objects, NAME=((name)))
env.Append(ALLOBJECTS = objects, PACKET_BUNDLES = cobject)
env.Install('$OBJINSTALLDIR', cobject)
- if tests : env.BoostUnitTest('test', tests + cobject)
- if includes : env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
- if os.path.exists("Doxyfile") : SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)) )
- if subscripts : SConscript(glob.glob("*/SConscript"))
+ if tests : env.BoostUnitTest('test', tests + cobject)
+ if includes : env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
+ if doxyfile : SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)) )
+ if subscripts : SConscript(subscripts)