Rev 6 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | jlesech | 1 | # Create and initialize the environment. |
2 | env = Environment() |
||
3 | |||
4 | # Set environment for AVR-GCC. |
||
5 | env['CC'] = 'avr-gcc' |
||
6 | env['CPPPATH'] = '/usr/lib/avr/include' |
||
7 | env['OBJCOPY'] = 'avr-objcopy' |
||
8 | env['SIZE'] = 'avr-size' |
||
9 | env['AR'] = 'avr-ar' |
||
10 | env['RANLIB'] = 'avr-ranlib' |
||
11 | env.Append(CCFLAGS = '-Os') |
||
12 | |||
13 | # Declare some variables about microcontroller. |
||
14 | # Microcontroller type. |
||
15 | DEVICE = 'atmega328p' |
||
16 | # Microcontroller frequency. |
||
17 | CPU_FREQUENCY = '16000000UL' # Hz |
||
18 | |||
19 | # Set environment for an Atmel AVR ATmega328p microcontroller. |
||
20 | env.Append(CCFLAGS = '-mmcu=' + DEVICE) |
||
21 | env.Append(LINKFLAGS = '-mmcu=' + DEVICE) |
||
22 | env.Append(CPPDEFINES = 'F_CPU=' + CPU_FREQUENCY) |
||
23 | |||
24 | # Append CPPPATH. |
||
25 | env.Append(CPPPATH = [ '#../' ]) |
||
26 | |||
27 | # Build library. |
||
28 | SConscript( |
||
29 | 'src/SConscript', |
||
30 | variant_dir = '#build/lib/', |
||
31 | exports = { 'env_target' : env, 'env_name' : 'env_arduino_uno', 'DEVICE' : DEVICE }, |
||
32 | duplicate = 0 |
||
33 | ) |
||
34 | |||
35 | # Append LIBPATH and LIBS. |
||
36 | env.Append(LIBPATH = [ '#build/lib/']) |
||
37 | env.Append(LIBS = [ 'digital_io' ]) |
||
38 | |||
39 | # Build demonstration program. |
||
40 | SConscript( |
||
41 | 'demo/SConscript', |
||
42 | variant_dir = '#build/demo/', |
||
43 | exports = { 'env_target' : env, 'env_name' : 'env_arduino_uno', 'DEVICE' : DEVICE }, |
||
44 | duplicate = 0 |
||
45 | ) |
||
46 | |||
47 | # Build test program. |
||
48 | SConscript( |
||
49 | 'test/SConscript', |
||
50 | variant_dir = '#build/test/', |
||
51 | exports = { 'env_target' : env, 'env_name' : 'env_arduino_uno', 'DEVICE' : DEVICE }, |
||
52 | duplicate = 0 |
||
53 | ) |
||
54 |