1 # -*- mode: python -*-
\r
2 # ZeroRadiant build scripts
\r
3 # TTimo <ttimo@idsoftware.com>
\r
4 # http://scons.sourceforge.net
\r
6 import sys, os, platform, cPickle
\r
10 conf_filename = 'site.sconf'
\r
13 sys.argv.index( '-h' )
\r
19 ======================================================================
\r
20 ZeroRadiant build system quick help
\r
22 You need scons v0.97.0d20070918.r2446 or newer
\r
24 Default build (release), just run scons at the toplevel
\r
27 $ scons config=debug
\r
28 ======================================================================
\r
34 # load up configurations from the save file
\r
35 if ( os.path.exists( conf_filename ) ):
\r
36 f = open( conf_filename )
\r
37 print 'reading saved configuration from site.conf'
\r
40 c = cPickle.load( f )
\r
41 active_configs.append( c )
\r
45 # read the command line and build configs
\r
46 config_statements = sys.argv[1:]
\r
47 active_configs = config.ConfigParser().parseStatements( active_configs, config_statements )
\r
48 assert( len( active_configs ) >= 1 )
\r
51 print 'saving updated configuration'
\r
52 f = open( conf_filename, 'wb' )
\r
53 for c in active_configs:
\r
54 cPickle.dump( c, f, -1 )
\r
56 print 'emit build rules'
\r
57 for c in active_configs:
\r
58 print 'emit configuration: %s' % repr( c )
\r