import sys ####################################################### # reusable functions and data structures ####################################################### # Platform to Target Map (specifies which default target to build on a platform) PLATFORM_TO_TARGET_MAP = { 'linux-i386' : 'x86-unknown-linux', 'linux2' : 'x86-unknown-linux', 'win32' : 'x86-microsoft-win32', 'cygwin' : 'x86-unknown-cygwin', 'darwin' : 'universal-apple-macosx' } CROSS_PLATFORMS = ['ppu-sony-ps3', 'arm-unknown-linux', 'mips-unknown-linux', 'powerpc-unknown-linux', 'arm-gp2x-linux', 'arm-symbian-symbianos'] def DefaultTarget(): if PLATFORM_TO_TARGET_MAP.has_key(sys.platform): return PLATFORM_TO_TARGET_MAP[sys.platform] else: return None ####################################################### # Main Build ####################################################### options = Options() options.AddOptions( EnumOption('target', 'build target', DefaultTarget(), allowed_values=PLATFORM_TO_TARGET_MAP.values()+CROSS_PLATFORMS), BoolOption('enable_profiling', 'enable profiling', False), ListOption('build_config', 'build configurations', 'Debug', names=['Debug', 'Release']) ) env = Environment(options=options).Copy() Help(options.GenerateHelpText(env)) ### call the actual build script for each build config for build_config in env['build_config']: env['build_config'] = build_config print '********** Configuring Build Target =', env['target'], '/', build_config, '********' SConscript('Build.scons', build_dir='Targets/'+env['target']+'/'+build_config, exports='env', duplicate=0)