Moved modules to their own directory.
[aftubes.git] / SConstruct
blobf70870e96ee54754b9d6df84567a1c7f3374364b
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 ('CC', 'Set the C compiler to use'),
8 ('LINK', 'Set the linker to use'),
9 ('CFLAGS', 'Change the flags for the compiler', '-Wall -std=c99 -pedantic -O3 -g -ffunction-sections'),
10 ('LINKFLAGS', 'Change the flags for the linker', '-Wl,--gc-sections'),
11 BoolOption('verbose', 'Show full commands during the build process', False),
14 env = Environment(options = opts)
15 Help(opts.GenerateHelpText(env))
16 opts.Save('scache.conf', env)
18 env['LIBS'] = ['m']
19 env['CPPPATH'] = ['#']
20 env['CPPDEFINES'] = {'_POSIX_SOURCE': None, '_GNU_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)