2 opts
= Options('scache.conf')
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
)
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',
31 build_dir
= env
['BUILDDIR'],