application: Start and stop recordings by pressing the play button.
[gps-watch.git] / SConstruct
1 import SCons
2 import os
3
4 root_env = Environment(ENV = {'PATH': os.environ['PATH']})
5
6 # Beautify output.
7 if ARGUMENTS.get('V', '0') != '1':
8     root_env['CCCOMSTR'] = '    CC $TARGET'
9     root_env['RUSTCCOMSTR'] = '    RUSTC $TARGET'
10     root_env['LINKCOMSTR'] = '    LINK $TARGET'
11     root_env['ARCOMSTR'] = '    AR $TARGET'
12     root_env['RANLIBCOMSTR'] = '    RANLIB $TARGET'
13     root_env['OBJCOPYCOMSTR'] = '    OBJCOPY $TARGET'
14
15 # Make colored output of e.g. gcc work.
16 root_env['ENV']['TERM'] = os.environ.get('TERM')
17
18 root_env.Append(CCFLAGS = [
19     '-std=gnu99',
20     '-Wall',
21     '-Wextra',
22     '-Wwrite-strings',
23 ])
24
25 root_env.Append(RUSTC = 'rustc')
26
27 root_env.Append(BUILDERS = { 'Rustc': Builder(
28     action=Action('$RUSTC $RUSTCFLAGS -o $TARGET $SOURCE', '$RUSTCCOMSTR'))})
29
30 root_env.Append(BUILDERS = { 'Objcopy': Builder(
31     action=Action('$OBJCOPY -O binary $OBJCOPYFLAGS $SOURCES $TARGET', '$OBJCOPYCOMSTR'),
32     suffix='.bin',
33     src_suffix='.elf')})
34
35 env = root_env.Clone()
36 env['variant_dir'] = 'build-target'
37 env['LIBPATH'] = env['variant_dir']
38 SConscript('SConscript.target', exports='env', variant_dir=env['variant_dir'], duplicate=0)
39
40 env = root_env.Clone()
41 env['variant_dir'] = 'build-test'
42 env['LIBPATH'] = env['variant_dir']
43 SConscript('SConscript.test', exports='env', variant_dir=env['variant_dir'], duplicate=0)