1#This file is adapted from http://www.scons.org/wiki/SconstructMultiple
2
3#get the mode flag from the command line
4#default to 'release' if the user didn't specify
5mymode = ARGUMENTS.get('mode', 'release')   #holds current mode
6
7#check if the user has been naughty: only 'debug' or 'release' allowed
8if not (mymode in ['debug', 'release']):
9    print "Error: expected 'debug' or 'release', found: " + mymode
10    Exit(1)
11
12#tell the user what we're doing
13print '**** Compiling in ' + mymode + ' mode...'
14
15debugcflags = ['-Wall', '-g', '-pedantic']   #extra compile flags for debug
16releasecflags = ['-O2']         #extra compile flags for release
17
18env = Environment()
19
20#make sure the sconscripts can get to the variables
21Export('env', 'mymode', 'debugcflags', 'releasecflags')
22
23#put all .sconsign files in one place
24env.SConsignFile()
25
26#specify the sconscript for CSSTidy
27project = 'csstidy'
28SConscript(project + '/SConscript', exports=['project'])
29
30