Documented coding guidelines (file naming, class naming etc)
[senf.git] / SConstruct
1 # -*- python -*-
2
3 import sys, glob, os.path, datetime
4 sys.path.append('senfscons')
5 import SENFSCons
6
7 ###########################################################################
8
9 # Load subversion information
10 svninfo = dict(
11     [ map(lambda y:y.strip(),x.split(":",1))
12       for x in os.popen("svn info").read().split("\n")
13       if ':' in x ] )
14 svninfo['commited'] = not(os.popen("svn status -q").read())
15
16 # Load utilities and setup libraries
17 SENFSCons.UseBoost()
18 SENFSCons.UseSTLPort()
19 env = SENFSCons.MakeEnvironment()
20
21 # Configure build
22 env.Append(
23    CPPPATH = [ '#' ],
24    LIBS = [ 'iberty' ],
25    DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
26    DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
27    ENV = { 'TODAY' : str(datetime.date.today()),
28            'REVISION' : svninfo['Revision'] + (not(svninfo['commited']) and " + local changes" or ""),
29            },
30 )
31
32 Export('env')
33
34 # Build modules (that is, instruct to build ... the build happens later)
35 SConscript(glob.glob("*/SConscript"))
36
37 SENFSCons.StandardTargets(env)
38 SENFSCons.GlobalTargets(env)
39 SENFSCons.Doxygen(env, extra_sources = [
40     'Sniffer/Sniffer.cc',
41 ])
42 SENFSCons.DoxyXRef(env,
43                    HTML_HEADER = '#/doclib/doxy-header-overview.html',
44                    HTML_FOOTER = '#/doclib/doxy-footer.html')
45
46 # Create Doxyfile.local if not cleaning and the file does not exist
47 # otherwise doxygen will barf on this non-existent file
48 if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"):
49     Execute(Touch("Doxyfile.local"))