Converted tabs to spaces, build into build/ dir
[mcc.git] / SConstruct
blob1b23cc52fd76be579c91fcc7455b051f6c90b919
1 # Build options
2 opts = Options('scache.conf')
3 opts.AddOptions(
4 PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
5 PathOption('DESTDIR', 'Set the installation root', '/'),
6 ('BUILDDIR', 'Set the sub-directory to put object files in', 'build'),
7 ('INCLUDE_DIRS', 'Set the default include directories to build into the compiler', '/include:/usr/include:/usr/local/include:/opt/include'),
8 ('CC', 'Set the C compiler to use'),
9 ('LINK', 'Set the linker to use'),
10 ('CFLAGS', 'Change the flags for the compiler', '-Wall -g -ffunction-sections'),
11 ('LINKFLAGS', 'Change the flags for the linker', '-Wl,--gc-sections'),
12 BoolOption('verbose', 'Show full commands during the build process', False),
15 env = Environment(options = opts)
16 Help(opts.GenerateHelpText(env))
17 opts.Save('scache.conf', env)
19 # Pretty coloured output
20 if not env['verbose']:
21 env['CCCOMSTR'] = ' Compiling \e[32m$TARGET\e[0m'
22 env['LINKCOMSTR'] = ' Linking \e[32m$TARGET\e[0m'
23 env['ARCOMSTR'] = ' Archiving \e[32m$TARGET\e[0m'
24 env['RANLIBCOMSTR'] = ' Indexing \e[32m$TARGET\e[0m'
26 SConscript('SConscript',
27 exports = ['env'],
28 build_dir = env['BUILDDIR'],
29 duplicate = 0)