Subversion Repositories idreammicro-avr

Rev

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

# Import build tools.
SConscript('min_env/build_tools.py')

# Create and initialize the environment.
env = Environment()

# Set environment for AVR-GCC.
env['CC'] = 'avr-gcc'
env['CPPPATH'] = '/usr/lib/avr/include'
env['OBJCOPY'] = 'avr-objcopy'
env['SIZE'] = 'avr-size'
env['AR'] = 'avr-ar'
env['RANLIB'] = 'avr-ranlib'
env.Append(CCFLAGS = '-Os')

# Define environment name.
env.Append(NAME = 'env_arduino_uno')

# Microcontroller type.
env.Append(MCU = 'atmega328p')
# Microcontroller frequency in Hertz.
env.Append(F_CPU = '16000000UL')

# Set environment for an Atmel AVR ATmega328p microcontroller.
env.Append(CCFLAGS = '-mmcu=' + env['MCU'])
env.Append(LINKFLAGS = '-mmcu=' + env['MCU'])
env.Append(CPPDEFINES = 'F_CPU=' + env['F_CPU'])

# Append CPPPATH.
env.Append(CPPPATH = [ '#../' ])

# Build library.
SConscript(
    'src/SConscript',
    variant_dir = '#build/lib/',
    exports = { 'env_target' : env },
    duplicate = 0
)

# Append LIBPATH and LIBS.
env.Append(LIBPATH = [ '#build/lib/'])
env.Append(LIBS = [ 'digital_io' ])

# Build demonstration program.
SConscript(
    'demo/SConscript',
    variant_dir = '#build/demo/',
    exports = { 'env_target' : env },
    duplicate = 0
)

# Build test program.
SConscript(
    'test/SConscript',
    variant_dir = '#build/test/',
    exports = { 'env_target' : env },
    duplicate = 0
)