
# RX63N and platform.
# ------------------------------

# For more info:

name=Renesas RX631
#version=0.4.0

# AVR compile variables
# --------------------- 

# Default "compiler.path" is correct, change only if you want to overidde the initial value
compiler.path={runtime.ide.path}/hardware/tools/gcc-rx/rx-elf/rx-elf/bin/
compiler.ar.path = {runtime.ide.path}/hardware/arduino/rx631/cores/core/
compiler.c.cmd=rx-elf-gcc
compiler.c.flags=-ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DTESTING=1 -DGRSAKURA -DARDUINO=100 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -O2 -flto -mlittle-endian-data -mcpu=rx600 -m64bit-doubles
compiler.S.cmd=rx-elf-gcc
compiler.S.flags=-ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DTESTING=1 -DGRSAKURA -DARDUINO=100 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -O2 -flto -mlittle-endian-data -mcpu=rx600 -m64bit-doubles
compiler.elf2hex.flags=-O binary
#compiler.elf2hex.flags=-O srec
compiler.elf2hex.cmd=rx-elf-objcopy
compiler.c.elf.cmd=rx-elf-ld
compiler.c.elf.flags=
compiler.ar.cmd=rx-elf-ar
compiler.ar.flags=rcs
compiler.ld.flags= -e_PowerON_Reset -no-keep-memory -S 
compiler.size.cmd=rx-elf-size
# this can be overriden in boards.txt
build.extra_flags=

# AVR compile patterns
# --------------------

## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {includes} {compiler.c.flags} -c -x c "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.c.cmd}" {includes} {compiler.c.flags} -c -x c++ "{source_file}" -o "{object_file}"

## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {includes} {compiler.S.flags} -c -x assembler-with-cpp "{source_file}" -o "{object_file}"

## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}"

## Combine gc-sections, archives, and objects
##recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-M={build.path}/{build.project_name}.map" {compiler.ld.flags} "-T{build.variant.path}/{build.ldscript}" {object_files} "{build.path}/interrupt_handlers.c.o" "{build.path}/vector_table.c.o" "{build.variant.path}/libGNU_RX_DSP_Little.a" "-L{build.path}" "{build.path}/{archive_file}" -o "{build.path}/{build.project_name}.elf" "-L{runtime.ide.path}/hardware/arduino/rx63n/cores/arduino" "-L{runtime.ide.path}/hardware/tools/gcc-rx/rx-elf/rx-elf/rx-elf/lib/64-bit-double" "-L{runtime.ide.path}/hardware/tools/gcc-rx/rx-elf/rx-elf/lib/gcc/rx-elf/4.8-GNURX_v14.03/64-bit-double" --no-flag-mismatch-warnings --start-group -lstdc++ -lnosys -lsim -lm -lc -lgcc --end-group

## for rapid compile
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-M={build.path}/{build.project_name}.map" {compiler.ld.flags} "-T{build.variant.path}/{build.ldscript}" {object_files} "{build.path}/interrupt_handlers.c.o" "{build.path}/vector_table.c.o" "{build.variant.path}/core_v100.a" "{build.variant.path}/libGNU_RX_DSP_Little.a" "-L{build.path}" "{build.path}/{archive_file}" -o "{build.path}/{build.project_name}.elf" "-L{runtime.ide.path}/hardware/arduino/rx63n/cores/arduino" "-L{runtime.ide.path}/hardware/tools/gcc-rx/rx-elf/rx-elf/rx-elf/lib/64-bit-double" "-L{runtime.ide.path}/hardware/tools/gcc-rx/rx-elf/rx-elf/lib/gcc/rx-elf/4.8-GNURX_v14.03/64-bit-double" --no-flag-mismatch-warnings --start-group -lstdc++ -lnosys -lsim -lm -lc -lgcc --end-group

## Create eeprom
recipe.objcopy.eep.pattern=

## Create hex
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*


# SAM3 Uploader tools
# -------------------

tools.savesketch.cmd=SaveSketch
tools.savesketch.cmd.windows=SaveSketch.bat
tools.savesketch.path={runtime.ide.path}/hardware/tools/rx

tools.savesketch.upload.params.verbose=
tools.savesketch.upload.params.quiet=
tools.savesketch.upload.pattern="{path}/{cmd}" GR-CITRUS "{build.path}\{build.project_name}.bin"