
# RX64M and platform.
# ------------------------------

# For more info:

name=Renesas RX64M
#version=1.2.2

# 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/rx64m/cores/
compiler.c.cmd=rx-elf-gcc
compiler.c.flags=-ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DGRKAEDE -DGRSAKURA -DARDUINO=144 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -g2 -g -flto -mlittle-endian-data -m64bit-doubles -mcpu=rx64m -Ihardware/arduino/rx64m/cores/ -Ihardware/arduino/rx64m/cores/core -Ihardware/arduino/rx64m/cores/core/avr -Ihardware/arduino/rx64m/cores/utility -Ihardware/arduino/rx64m/cores/utility/driver -Ihardware/arduino/rx64m/cores/utility/r_byteq_v1.30 -Ihardware/arduino/rx64m/cores/utility/r_config -Ihardware/arduino/rx64m/cores/utility/T4_src -Ihardware/arduino/rx64m/cores/utility/T4_src/checksum -Ihardware/arduino/rx64m/cores/utility/T4_src/checksum/rx -Ihardware/arduino/rx64m/cores/lib -Ihardware/arduino/rx64m/libraries/EEPROM -Ihardware/arduino/rx64m/libraries/EEPROM/utility -Ihardware/arduino/rx64m/libraries/Firmata -Ihardware/arduino/rx64m/libraries/LiquidCrystal -Ihardware/arduino/rx64m/libraries/RTC -Ihardware/arduino/rx64m/libraries/RTC/utility -Ihardware/arduino/rx64m/libraries/Image -Ihardware/arduino/rx64m/libraries/Image/utility -Ihardware/arduino/rx64m/libraries/SD -Ihardware/arduino/rx64m/libraries/SD/utility -Ihardware/arduino/rx64m/libraries/Servo -Ihardware/arduino/rx64m/libraries/SoftwareSerial -Ihardware/arduino/rx64m/libraries/SPI -Ihardware/arduino/rx64m/libraries/Stepper -Ihardware/arduino/rx64m/libraries/Wire -Ihardware/arduino/rx64m/libraries/Wire/utility -Ihardware/arduino/rx64m/cores/rx64m
compiler.S.cmd=rx-elf-gcc
compiler.S.flags=-ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DGRKAEDE -DGRSAKURA -DARDUINO=144 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -g2 -g -flto -mlittle-endian-data -m64bit-doubles -mcpu=rx64m
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} {build.extra_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} {build.extra_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}" {compiler.ld.flags} "-T{build.variant.path}/{build.ldscript}" {object_files} "{build.variant.path}/interrupt_handlers.o" "{build.variant.path}/vector_table.o" "{build.variant.path}/gr_common.a" "-L{build.path}" "{build.path}/{archive_file}" -o "{build.path}/{build.project_name}.elf" "-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.4.201801-GNURX/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-KAEDE "{build.path}\{build.project_name}.bin"