Subversion Repositories idreammicro-avr

Rev

Rev 6 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 jlesech 1
# Import build tools.
2
SConscript('min_env/build_tools.py')
3
 
2 jlesech 4
# Create and initialize the environment.
5
env = Environment()
6
 
7
# Set environment for AVR-GCC.
8
env['CC'] = 'avr-gcc'
9
env['CPPPATH'] = '/usr/lib/avr/include'
10
env['OBJCOPY'] = 'avr-objcopy'
11
env['SIZE'] = 'avr-size'
12
env['AR'] = 'avr-ar'
13
env['RANLIB'] = 'avr-ranlib'
14
env.Append(CCFLAGS = '-Os')
15
 
6 jlesech 16
# Define environment name.
17
env.Append(NAME = 'env_arduino_uno')
18
 
2 jlesech 19
# Microcontroller type.
6 jlesech 20
env.Append(MCU = 'atmega328p')
21
# Microcontroller frequency in Hertz.
22
env.Append(F_CPU = '16000000UL')
2 jlesech 23
 
24
# Set environment for an Atmel AVR ATmega328p microcontroller.
6 jlesech 25
env.Append(CCFLAGS = '-mmcu=' + env['MCU'])
26
env.Append(LINKFLAGS = '-mmcu=' + env['MCU'])
27
env.Append(CPPDEFINES = 'F_CPU=' + env['F_CPU'])
2 jlesech 28
 
29
# Append CPPPATH.
30
env.Append(CPPPATH = [ '#../' ])
31
 
32
# Build library.
33
SConscript(
34
    'src/SConscript',
35
    variant_dir = '#build/lib/',
6 jlesech 36
    exports = { 'env_target' : env },
2 jlesech 37
    duplicate = 0
38
)
39
 
40
# Append LIBPATH and LIBS.
41
env.Append(LIBPATH = [ '#build/lib/'])
42
env.Append(LIBS = [ 'digital_io' ])
43
 
44
# Build demonstration program.
45
SConscript(
46
    'demo/SConscript',
47
    variant_dir = '#build/demo/',
6 jlesech 48
    exports = { 'env_target' : env },
2 jlesech 49
    duplicate = 0
50
)
51
 
52
# Build test program.
53
SConscript(
54
    'test/SConscript',
55
    variant_dir = '#build/test/',
6 jlesech 56
    exports = { 'env_target' : env },
2 jlesech 57
    duplicate = 0
58
)
59