Subversion Repositories idreammicro-avr

Rev

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

# Import environment set for target.
Import('env_target', 'env_name', 'DEVICE')

# Set target name.
TARGET = 'helloworld'

# Set libraries to use.
libraries = [
    'digital_io'
]

# Build libraries.
for library in libraries:
    SConscript(
        '#libraries/' + library + '/SConscript',
        exports = { 'env_target' : env_target, 'env_name' : env_name },
            duplicate = 0
    )

# Set source file.
sources = 'helloworld.c'

# Build program.
env_target.Program(target = TARGET + '.elf', source = sources)

# Create hex binary file.
env_target.Command(
    TARGET + '.hex',
    TARGET + '.elf',
    env_target['OBJCOPY'] + ' -O ihex $SOURCE $TARGET'
)

# Compute memory usage.
env_target.Command(
    None,
    TARGET + '.elf',
    env_target['SIZE'] + ' -C --mcu=' + DEVICE + ' $SOURCE'
)