Rev 40 | 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_avr = Environment() |
||
| 3 | |||
| 4 | # Set environment for AVR-GCC. |
||
| 61 | jlesech | 5 | env_avr['CC'] = 'avr-gcc' |
| 6 | env_avr['OBJCOPY'] = 'avr-objcopy' |
||
| 7 | env_avr['SIZE'] = 'avr-size' |
||
| 8 | env_avr['AR'] = 'avr-ar' |
||
| 9 | env_avr['RANLIB'] = 'avr-ranlib' |
||
| 10 | env_avr['CPPPATH'] = '/usr/lib/avr/include' |
||
| 2 | jlesech | 11 | |
| 27 | jlesech | 12 | # Set language standard. |
| 13 | env_avr.Append(CCFLAGS = '-std=c99') |
||
| 14 | |||
| 40 | jlesech | 15 | # Set optimization level and call prologues/epilogues. |
| 16 | env_avr.Append(CCFLAGS = '-Os -mcall-prologues') |
||
| 27 | jlesech | 17 | |
| 40 | jlesech | 18 | # Use short types. |
| 19 | env_avr.Append(CCFLAGS = '-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums') |
||
| 20 | |||
| 21 | # Don't include unused function and data. |
||
| 22 | env_avr.Append(CCFLAGS = '-ffunction-sections -fdata-sections') |
||
| 23 | env_avr.Append(LINKFLAGS = '-Wl,--gc-sections') |
||
| 24 | |||
| 25 | # Enable linker relaxation. |
||
| 26 | env_avr.Append(LINKFLAGS = '-Wl,--relax') |
||
| 27 | |||
| 2 | jlesech | 28 | # Export environment set for AVR-GCC. |
| 29 | Export('env_avr') |