2012-01-11 13:59:16 +01:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
# SAM3 compile variables
|
|
|
|
# ---------------------
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
name=Atmel SAM3
|
2012-01-13 20:41:01 +01:00
|
|
|
compiler.path={ide.path}/hardware/tools/g++_arm_none_eabi/bin/
|
2012-01-11 13:59:16 +01:00
|
|
|
compiler.c.cmd=arm-none-eabi-gcc
|
|
|
|
compiler.c.flags=-c -g -Os -w -mthumb -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf
|
|
|
|
compiler.c.elf.cmd=arm-none-eabi-gcc
|
2012-01-13 19:09:07 +01:00
|
|
|
compiler.c.elf.flags=-Os -Wl,--gc-sections
|
2012-01-11 13:59:16 +01:00
|
|
|
compiler.S.flags=-c -g -assembler-with-cpp
|
|
|
|
compiler.cpp.cmd=arm-none-eabi-g++
|
|
|
|
compiler.cpp.flags=-c -g -Os -w -mthumb -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf
|
|
|
|
compiler.ar.cmd=arm-none-eabi-ar
|
|
|
|
compiler.ar.flags=rcs
|
|
|
|
compiler.objcopy.cmd=arm-none-eabi-objcopy
|
|
|
|
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
|
|
|
|
compiler.elf2hex.flags=-O binary
|
|
|
|
compiler.elf2hex.cmd=arm-none-eabi-objcopy
|
|
|
|
compiler.ldflags=
|
|
|
|
compiler.size.cmd=arm-none-eabi-size
|
|
|
|
compiler.upload.cmd=
|
|
|
|
compiler.upload.flags=
|
|
|
|
compiler.define=-DARDUINO=
|
|
|
|
|
2012-01-13 20:41:01 +01:00
|
|
|
compiler.libsam.c.flags=-I{build.system.path}/libsam -I{build.system.path}/CMSIS/Include/
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
# SAM3 compile patterns
|
|
|
|
# ---------------------
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Compile c files
|
2012-01-13 20:41:01 +01:00
|
|
|
recipe.c.o.pattern={compiler.path}{compiler.c.cmd} {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{software}={ide.version} {build.extra_flags} {compiler.libsam.c.flags} {includes} {source_file} -o {object_file}
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Compile c++ files
|
2012-01-13 20:41:01 +01:00
|
|
|
recipe.cpp.o.pattern={compiler.path}{compiler.cpp.cmd} {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -D{software}={ide.version} {build.extra_flags} {compiler.libsam.c.flags} {includes} {source_file} -o {object_file}
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Create archives
|
2012-01-13 20:41:01 +01:00
|
|
|
recipe.ar.pattern={compiler.path}{compiler.ar.cmd} {compiler.ar.flags} {build.path}/{archive_file} {object_file}
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Combine gc-sections, archives, and objects
|
2012-01-13 20:41:01 +01:00
|
|
|
recipe.c.combine.pattern={compiler.path}{compiler.c.elf.cmd} {compiler.c.elf.flags} -mcpu={build.mcu} -T{build.variant.path}/{build.ldscript} -Wl,-Map,{build.path}/{project_name}.map -o {build.path}/{project_name}.elf -L{build.path} -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} {build.variant.path}/libsam_sam3u4e_gcc_rel.a {build.path}/{archive_file} -Wl,--end-group
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Create eeprom
|
2012-01-11 13:59:16 +01:00
|
|
|
recipe.objcopy.eep.pattern=
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Create hex
|
2012-01-13 20:41:01 +01:00
|
|
|
recipe.objcopy.hex.pattern={compiler.path}{compiler.elf2hex.cmd} {compiler.elf2hex.flags} {build.path}/{project_name}.elf {build.path}/{project_name}.bin
|
2011-06-25 12:53:35 -04:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Compute Size
|
2012-01-13 20:41:01 +01:00
|
|
|
#recipe.size.pattern={compiler.path}{1} {2}.elf
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2011-06-25 12:53:35 -04:00
|
|
|
|