+++ /dev/null
-Import('env')
-import SENFSCons
-
-import glob
-import os.path
-
-###########################################################################
-
-#for f in glob.glob('*.cc'):
-# bin = os.path.splitext(f)[0]
-#
-# SENFSCons.Binary(env, bin, f,
-# LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
-# OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o',
-# '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o' ]);
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-sources, tests, includes = SENFSCons.Glob(env)
-
-env.Alias('examples', env.Program('mcsniffer', sources + [ '${LOCALLIBDIR}/AllBundles.o' ]))
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-env.Alias('examples', env.Program('multimcloop', [ 'MultiMCLoop.cc' ]))
ALPHABETICAL_INDEX = NO
PROJECT_NAME = Examples
EXAMPLE_PATH = .
+
+# extra_source: env.Dia2Png('RateStuffer/ratestuffer.dia')
\ No newline at end of file
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-sources, tests, includes = SENFSCons.Glob(env)
-
-env.Alias('examples', env.Program('ratestuffer', sources))
-
-SENFSCons.Doxygen(env, extra_sources=[
- env.Dia2Png('ratestuffer.dia')
-])
# -*- 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) )
+SENFSCons.IndexPage(env, 'Mainpage.dox', title="Examples")
-MAINPAGE="""
-/** \mainpage Examples
-
- \htmlonly
- <dl>
-
-{{ for name, title in EXAMPLES:
- <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
-}}
-
- </dl>
- \endhtmlonly
- */
-"""
-
-file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
+SENFSCons.Doxygen(env)
-SConscript(glob.glob("*/SConscript"))
+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)
-env.Clean('all','Mainpage.dox')
-env.Clean('all_docs','Mainpage.dox')
-SENFSCons.Doxygen(env)
+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)
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-sources, tests, includes = SENFSCons.Glob(env)
-
-env.Alias('examples', env.Program('sniffer', sources + [ '${LOCALLIBDIR}/AllBundles.o' ]))
-SENFSCons.Doxygen(env)
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-env.Alias('examples', env.Program('client', 'client.cc'))
-env.Alias('examples', env.Program('server', 'server.cc'))
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-env.Alias('examples', env.Program('udpClient', 'udpClient.cc'))
-env.Alias('examples', env.Program('udpServer', 'udpServer.cc'))
-
-SENFSCons.Doxygen(env)
+++ /dev/null
-Import('env')
-import SENFSCons, glob
-
-###########################################################################
-
-#sources = SENFSCons.GlobSources()
-
-#SENFSCons.StandardTargets(env)
-
-#SENFSCons.Object(env,
-# target = 'psi2ts.o',
-# sources = sources,
-# LIBS = ['senf'])
###########################################################################
-HOWTOS = []
-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:
- HOWTOS.append( (dox.split('/',1)[0], title) )
-
-MAINPAGE="""
-/** \mainpage HowTo's
-
- \htmlonly
- <dl>
-
-{{ for name, title in HOWTOS:
- <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
-}}
-
- </dl>
- \endhtmlonly
- */
-"""
-
-file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
+SENFSCons.IndexPage(env, 'Mainpage.dox', title="HowTo's")
SConscript(glob.glob("*/SConscript"))
sconscripts = sorted(glob.glob("*/SConscript"))
if sconscripts:
- EXTENSIONS = []
- for script in sconscripts:
- name = os.path.split(script)[0]
- dox = os.path.join(name, 'Mainpage.dox')
- title = ''
- if os.path.exists(dox):
- title = ([''] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
- if '\\mainpage' in line ])[-1]
- EXTENSIONS.append((name, title))
-
-
- MAINPAGE="""
- /** \mainpage Extensions
-
- This folder contains additional SENF extensions which are built
- into the senf libarary but are not part of senf proper.
-
- \htmlonly
- <dl>
-
-{{ for name, title in EXTENSIONS:
- <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
-}}
-
- </dl>
- \endhtmlonly
- */
- """
-
- file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary()))
+ SENFSCons.IndexPage(env, 'Mainpage.dox', title="Extensions",
+ text="""This folder contains additional SENF extensions which are built
+ into the senf libarary but are not part of senf proper.""")
SConscript(sconscripts)
-import os.path, glob
+import os.path, glob, yaptu
import SCons.Options, SCons.Environment, SCons.Script.SConscript, SCons.Node.FS
import SCons.Defaults, SCons.Action
from SCons.Script import *
denv.update(kw)
return { 'DOXYENV' : denv,
'MODULE' : module,
- 'OUTPUT_DIRECTORY': output_directory };
+ 'OUTPUT_DIRECTORY': output_directory,
+ 'DOXYGENCOM' : "site_scons/lib/doxygen.sh $DOXYOPTS $SOURCE",
+ };
opts = [ '--tagfile-name', '"${MODULE}.tag"',
'--output-dir', '$OUTPUT_DIRECTORY' ]
# (need to exclude the 'clean' case, otherwise we'll have duplicate nodes)
if not env.GetOption('clean'):
tagfile = env.Doxygen(doxyfile, DOXYOPTS = opts + [ '--tagfile' ],
- **vars(generate_tagfile='doc/${MODULE}.tag'))
+ **vars(generate_tagfile='${OUTPUT_DIRECTORY}/${MODULE}.tag'))
env.Append(ALL_TAGFILES = [ tagfile[0].abspath ])
env.Depends(tagfile, [ env.File('#/site_scons/lib/doxygen.sh'),
env.File('#/site_scons/lib/tag-munge.xsl') ])
for f in headers ]))
env.Clean(env.Alias('all'), target)
+
+INDEXPAGE="""
+/** \mainpage ${TITLE}
+
+ ${TEXT}
+
+ \htmlonly
+ <dl>
+
+{{ for name, title in SUBPAGES:
+ <dt><a href="../../${name}/doc/html/index.html">${name}</a></dt><dd>${title}</a></dd>
+}}
+
+ </dl>
+ \endhtmlonly
+ */
+"""
+
+def IndexPage(env, name, title, text=""):
+ SUBPAGES = []
+ for dox in sorted(glob.glob("*/Mainpage.dox")):
+ subtitle = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
+ if '\\mainpage' in line ])[-1]
+ if subtitle:
+ SUBPAGES.append( (dox.split('/',1)[0], subtitle) )
+ file(name,"w").write(yaptu.process(
+ INDEXPAGE, globals(), { 'TITLE': title, 'TEXT': text, 'SUBPAGES': SUBPAGES }))
+ env.Clean('all',name)
+ env.Clean('all_docs',name)
+
+
###########################################################################
# The following functions serve as simple macros for most SConscript files
#
## Find $TOPDIR
-cd "$doxydir"
-while [ ! -r "SConstruct" -a "`pwd`" != "/" ]; do cd ..; done
-if [ ! -r "SConstruct" ]; then
- echo "topdir not found"
- exit 1;
+if [ -z "$TOPDIR" ]; then
+ cd "$doxydir"
+ while [ ! -r "SConstruct" -a "`pwd`" != "/" ]; do cd ..; done
+ if [ ! -r "SConstruct" ]; then
+ echo "topdir not found"
+ exit 1;
+ fi
+ TOPDIR="`pwd`";
fi
-TOPDIR="`pwd`";
+
reltopdir="`relpath "$doxydir/$output_dir/$html_dir" "$TOPDIR"`" #`"
cd "$doxydir"
done
fi
+## Remove empty tagfiles from list of tagfiles
+
+x="$tagfiles"; tagfiles=""
+for f in $x; do
+ if [ -s "$f" ]; then
+ tagfiles="$tagfiles${tagfiles:+ }$f"
+ fi
+done
+
## Call doxygen proper
generate_tagfile=""
fi
export TOPDIR LIBDIR html tagfile tagfile_name tagfiles output_dir html_dir generate_tagfile
+echo "+ cd $doxydir"
cmd ${DOXYGEN:-doxygen}
SCons.Action.Action("$DOXYGENCOM")(target, source, env.Clone(ENV = e), show=False)
def doxyActionStr(target, source, env):
- return env.subst("$DOXYGENCOM")
+ return env.subst("$DOXYGENCOM",target=target,source=source)
def generate(env):
"""