Added automatic format conversion.
[aftubes.git] / SConstruct
blobd0521609b9e0a4af589e5a4014eb1749f041d3a7
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 -std=c99 -pedantic -O3 -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 env['LIBS'] = ['m']
20 env['CPPDEFINES'] = {'_POSIX_SOURCE': None}
22 # Pretty coloured output
23 if not env['verbose']:
24 env['CCCOMSTR'] = ' Compiling \e[32m$TARGET\e[0m'
25 env['LINKCOMSTR'] = ' Linking \e[32m$TARGET\e[0m'
26 env['ARCOMSTR'] = ' Archiving \e[32m$TARGET\e[0m'
27 env['RANLIBCOMSTR'] = ' Indexing \e[32m$TARGET\e[0m'
29 SConscript('SConscript',
30 exports = ['env'],
31 build_dir = env['BUILDDIR'],
32 duplicate = 0)