doclib: Clean up documentation generation
[senf.git] / SConstruct
index 2753d30..cc4dc67 100644 (file)
@@ -8,8 +8,8 @@ import SENFSCons
 
 # This hack is needed for SCons V 0.96.1 compatibility. In current SCons versions
 # we can just use 'env.AlwaysBuild(env.Alias(target), [], action)'
-def PhonyTarget(env, target, action):
-    env.AlwaysBuild(env.Command(target + '.phony', 'SConstruct', env.Action(action)))
+def PhonyTarget(env, target, action, sources=[]):
+    env.AlwaysBuild(env.Command(target + '.phony', [ 'SConstruct' ] + sources, env.Action(action)))
     env.Alias(target, target + '.phony')
 
 def updateRevision(target, source, env):
@@ -112,6 +112,7 @@ debsrc       Build debian source package
 debbin       Build debian binary package
 linklint     Check links of doxygen documentation with 'linklint'
 fixlinks     Fix broken links in doxygen documentation
+valgrind     Run all tests under valgrind/memcheck
 """)
 
 if os.environ.get('debian_build'):
@@ -168,6 +169,8 @@ if not env.GetOption('clean') and not os.path.exists(".prepare-stamp") \
 
 env.Clean('all', '.prepare-stamp')
 
+# Not nice, but until we get to fixing the dependency jungle
+# concerning generated sources ...
 scripts = []
 dependencies = []
 
@@ -224,9 +227,9 @@ PhonyTarget(env, 'debbin', [
 PhonyTarget(env, 'linklint', [
     'rm -rf linklint',
     'linklint -doc linklint -limit 99999999 `find -type d -name html -printf "/%P/@ "`',
-    '[ ! -r linklint/errorX.html ] || python linklint_addnames.py <linklint/errorX.html >linklint/errorX.html.new',
+    '[ ! -r linklint/errorX.html ] || python doclib/linklint_addnames.py <linklint/errorX.html >linklint/errorX.html.new',
     '[ ! -r linklint/errorX.html.new ] || mv linklint/errorX.html.new linklint/errorX.html',
-    '[ ! -r linklint/errorAX.html ] || python linklint_addnames.py <linklint/errorAX.html >linklint/errorAX.html.new',
+    '[ ! -r linklint/errorAX.html ] || python doclib/linklint_addnames.py <linklint/errorAX.html >linklint/errorAX.html.new',
     '[ ! -r linklint/errorAX.html.new ] || mv linklint/errorAX.html.new linklint/errorAX.html',
     'echo -e "\\nLokal link check results: linklint/index.html\\nRemote link check results: linklint/urlindex.html\\n"',
 ])
@@ -237,6 +240,10 @@ PhonyTarget(env, 'fixlinks', [
 
 PhonyTarget(env, 'prepare', [])
 
+PhonyTarget(env, 'valgrind', [
+    'find -name .test.bin | while read test; do echo; echo "Running $$test"; echo; valgrind --tool=memcheck --error-exitcode=99 --suppressions=valgrind.sup $$test $BOOSTTESTARGS; [ $$? -ne 99 ] || exit 1; done'
+    ], [ 'all_tests' ])
+
 env.Clean('all', env.Dir('linklint'))
 
 env.Clean('all','.prepare-stamp')