X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FMainpage.dox;h=5c81984000efaba18090b24acf9fb652e2040876;hb=f2cc6f8a4ca99301f9f26156803e541ec2dff66b;hp=159b773da4f916de586716b1b66cfaf378612f04;hpb=58e527462abb46e321c94fda65f758b67ac3aef2;p=senf.git diff --git a/senfscons/Mainpage.dox b/senfscons/Mainpage.dox index 159b773..5c81984 100644 --- a/senfscons/Mainpage.dox +++ b/senfscons/Mainpage.dox @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -27,13 +27,68 @@ namespace senfscons { The Senf Build Environment is based on the SCons software construction tool. SCons is a python based replacement for \c make. SENFScons consists of several SCons builders as well as some global configuration and - build utilities. SEBFScons tightly integrates the Boost.Test unit testing framework. It also incorporates a very flexible infrastructure to build software documentation using Doxygen. This infrastructure uses quite a bit of pre- and postprocessing (which is integrated with the provided Doxygen builder) to fix some doxygen problems and generate a (IMHO) more readable layout. + \section senfutil Building Projects using SENF + + When building projects using senf, SENFSCons has a very simple helper module \ref senfutil to + make the building of libraries utilizing senf simpler: + \code + import sys + sys.path.extend(('senf/senfscons','/usr/lib/senf/senfscons')) + import os.path, glob, senfutil + + env = Environment() + + senfutil.SetupForSENF( env ) + + env.Append( + + LIBS = [ ], + CXXFLAGS = [ '-Wall', '-Woverloaded-virtual' ], + LINKFLAGS = [ ], + + CXXFLAGS_debug = [ ], + LINKFLAGS_debug = [ ], + LOGLEVELS_debug = [ 'senf::log::Debug||VERBOSE' ], + + CXXFLAGS_final = [ '-O3' ], + LINKFLAGS_final = [ ], + LOGLEVELS_final = [ ], + + SENF_BUILDOPTS = [ ], + + ) + + env.Default( + env.Program( target = 'udpforward', + source = glob.glob('*.cc') ) + ) + + env.Clean(DEFAULT_TARGETS, [ 'udpforward.log', 'udpforward.pid' ]) + \endcode + + This example builds a simple binary from a number of source files (all '.cc' files). It links + against the SENF library and automatically sets all the correct compiler options using + senfutil.SetupForSENF( env ). + + This script automatically uses a SENF installation either symlinked or imported into the current + project in directory 'senf' or, if this directory does not exist, a globaly installed SENF. A + locally installed SENF is automatically recompiled if needed. Parallel building is also + supported. + + This script automatically supports the \c final and \c LOGLEVELS command line parameters. The + LOGLEVELS parameter uses a much more readable syntax than SENF_LOG_CONF: +
+    $ scons -j2 final=1 \
+          LOGLEVELS='senf::log::Debug||IMPORTANT myapp::Transactions|mytrans::Area|VERBOSE'
+    
+ \section layout The Project Layout A Project using the SENFSCons infrastructure will always use a consistent directory layout. The