Subversion Repositories idreammicro-avr

Rev

Rev 40 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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

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

# Set language standard.
env_avr.Append(CCFLAGS = '-std=c99')

# Set optimization level and call prologues/epilogues.
env_avr.Append(CCFLAGS = '-Os -mcall-prologues')

# Use short types.
env_avr.Append(CCFLAGS = '-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums')

# Don't include unused function and data.
env_avr.Append(CCFLAGS = '-ffunction-sections -fdata-sections')
env_avr.Append(LINKFLAGS = '-Wl,--gc-sections')

# Enable linker relaxation.
env_avr.Append(LINKFLAGS = '-Wl,--relax')

# Export environment set for AVR-GCC.
Export('env_avr')