Subversion Repositories idreammicro-avr

Rev

Rev 2 | Rev 7 | Go to most recent revision | Details | Compare with Previous | 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
 
6 jlesech 13
# Define environment name.
14
env.Append(NAME = 'env_arduino_uno')
15
 
2 jlesech 16
# Microcontroller type.
6 jlesech 17
env.Append(MCU = 'atmega328p')
18
# Microcontroller frequency in Hertz.
19
env.Append(F_CPU = '16000000UL')
2 jlesech 20
 
21
# Set environment for an Atmel AVR ATmega328p microcontroller.
6 jlesech 22
env.Append(CCFLAGS = '-mmcu=' + env['MCU'])
23
env.Append(LINKFLAGS = '-mmcu=' + env['MCU'])
24
env.Append(CPPDEFINES = 'F_CPU=' + env['F_CPU'])
2 jlesech 25
 
26
# Append CPPPATH.
27
env.Append(CPPPATH = [ '#../' ])
28
 
29
# Build library.
30
SConscript(
31
    'src/SConscript',
32
    variant_dir = '#build/lib/',
6 jlesech 33
    exports = { 'env_target' : env },
2 jlesech 34
    duplicate = 0
35
)
36
 
37
# Append LIBPATH and LIBS.
38
env.Append(LIBPATH = [ '#build/lib/'])
39
env.Append(LIBS = [ 'digital_io' ])
40
 
41
# Build demonstration program.
42
SConscript(
43
    'demo/SConscript',
44
    variant_dir = '#build/demo/',
6 jlesech 45
    exports = { 'env_target' : env },
2 jlesech 46
    duplicate = 0
47
)
48
 
49
# Build test program.
50
SConscript(
51
    'test/SConscript',
52
    variant_dir = '#build/test/',
6 jlesech 53
    exports = { 'env_target' : env },
2 jlesech 54
    duplicate = 0
55
)
56