
# RZ/A1H and platform.
# ------------------------------

# For more info:

name=Renesas RZ/A1H
#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-arm/
compiler.path=hardware/tools/gcc-arm/
compiler.ar.path=hardware/arduino/rza1h/cores/arduino/
compiler.c.cmd=bin/arm-none-eabi-gcc
cpu=-mcpu=cortex-a9 -mthumb -mthumb-interwork -marm -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -mno-unaligned-access
compiler.c.flags={cpu} -c -g -fno-common -fmessage-length=0 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -fno-delete-null-pointer-checks -fomit-frame-pointer -MMD -MP -Wall -W -fsigned-char -DNDEBUG -Os -DTARGET_RZ_A1H -DTARGET_MBRZA1H -DMBED_BUILD_TIMESTAMP=1453127759.56 -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -DTARGET_CORTEX_A -D__MBED__=1 -DTARGET_RENESAS -DTARGET_FF_ARDUINO -D__MBED_CMSIS_RTOS_CA9 -D__EVAL -D__FPU_PRESENT -D__CMSIS_RTOS -DTARGET_A9 -D__CORTEX_A9 -DARM_MATH_CA9 -DGRPEACH -I./gr_build -Ihardware/arduino/rza1h/cores/arduino -Ihardware/arduino/rza1h/cores/arduino/avr -Ihardware/arduino/rza1h/cores/arduino/utility -Ihardware/arduino/rza1h/cores/arduino/utility/driver -Ihardware/arduino/rza1h/cores/arduino/utility/r_byteq_v1.30 -Ihardware/arduino/rza1h/cores/arduino/utility/r_config -Ihardware/arduino/rza1h/libraries -Ihardware/arduino/rza1h/libraries/EEPROM -Ihardware/arduino/rza1h/libraries/EEPROM/utility -Ihardware/arduino/rza1h/libraries/Firmata -Ihardware/arduino/rza1h/libraries/LiquidCrystal -Ihardware/arduino/rza1h/libraries/RTC -Ihardware/arduino/rza1h/libraries/RTC/utility -Ihardware/arduino/rza1h/libraries/SD -Ihardware/arduino/rza1h/libraries/SD/utility -Ihardware/arduino/rza1h/libraries/Servo -Ihardware/arduino/rza1h/libraries/SoftwareSerial -Ihardware/arduino/rza1h/libraries/SPI -Ihardware/arduino/rza1h/libraries/Stepper -Ihardware/arduino/rza1h/libraries/USB_Host -Ihardware/arduino/rza1h/libraries/USB_Host/utilities -Ihardware/arduino/rza1h/libraries/Wire -Ihardware/arduino/rza1h/libraries/Wire/utility -I{compiler.path}/mbed-lib -I{compiler.path}/mbed-lib/EthernetInterface -I{compiler.path}/mbed-lib/EthernetInterface/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/api -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core/ipv4 -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core/snmp -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/ipv4 -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/ipv4/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/netif -I{compiler.path}/mbed-lib/EthernetInterface/lwip/netif -I{compiler.path}/mbed-lib/EthernetInterface/lwip/netif/ppp -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth/arch -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth/arch/TARGET_RZ_A1H -I{compiler.path}/mbed-lib/EthernetInterface/lwip-sys -I{compiler.path}/mbed-lib/EthernetInterface/lwip-sys/arch -I{compiler.path}/mbed-lib/EthernetInterface/Socket -I{compiler.path}/mbed-lib/mbed-rtos -I{compiler.path}/mbed-lib/mbed-rtos/rtos -I{compiler.path}/mbed-lib/mbed-rtos/rtx -I{compiler.path}/mbed-lib/mbed-rtos/rtx/TARGET_CORTEX_A -I{compiler.path}/mbed-lib/mbed-rtos/rtx/TARGET_CORTEX_A/TOOLCHAIN_GCC -I{compiler.path}/mbed-lib/mbed-src -I{compiler.path}/mbed-lib/mbed-src/api -I{compiler.path}/mbed-lib/mbed-src/common -I{compiler.path}/mbed-lib/mbed-src/hal -I{compiler.path}/mbed-lib/mbed-src/targets -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iobitmasks -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iodefines -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/TOOLCHAIN_GCC_ARM -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TOOLCHAIN_GCC -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TOOLCHAIN_GCC/TARGET_CORTEX_A -I{compiler.path}/mbed-lib/mbed-src/targets/hal -I{compiler.path}/mbed-lib/mbed-src/targets/hal/TARGET_RENESAS -I{compiler.path}/mbed-lib/mbed-src/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H -Ihardware/arduino/rza1h/cores/arduino -Ihardware/arduino/rza1h/libraries/LiquidCrystal -Ihardware/arduino/rza1h/libraries/SPI -Ihardware/arduino/rza1h/libraries/SD -Ihardware/arduino/rza1h/libraries/SD/utility -Ihardware/arduino/rza1h/libraries/Wire -Ihardware/arduino/rza1h/libraries/RTC -Ihardware/arduino/rza1h/libraries/Servo -I. -I{compiler.path}/mbed-lib/mbed-src -I{compiler.path}/mbed-lib/mbed-src/api -I{compiler.path}/mbed-lib/mbed-src/hal -I{compiler.path}/mbed-lib/mbed-src/targets -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iobitmasks -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iodefines -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/TOOLCHAIN_GCC_ARM -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TOOLCHAIN_GCC -I{compiler.path}/mbed-lib/mbed-src/targets/cmsis/TOOLCHAIN_GCC/TARGET_CORTEX_A -I{compiler.path}/mbed-lib/mbed-src/targets/hal -I{compiler.path}/mbed-lib/mbed-src/targets/hal/TARGET_RENESAS -I{compiler.path}/mbed-lib/mbed-src/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H -I{compiler.path}/mbed-lib/mbed-src/common -I{compiler.path}/mbed-lib/EthernetInterface -I{compiler.path}/mbed-lib/EthernetInterface/Socket -I{compiler.path}/mbed-lib/EthernetInterface/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/api -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core/ipv4 -I{compiler.path}/mbed-lib/EthernetInterface/lwip/core/snmp -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/ipv4 -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/ipv4/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/lwip -I{compiler.path}/mbed-lib/EthernetInterface/lwip/include/netif -I{compiler.path}/mbed-lib/EthernetInterface/lwip/netif -I{compiler.path}/mbed-lib/EthernetInterface/lwip/netif/ppp -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth/arch -I{compiler.path}/mbed-lib/EthernetInterface/lwip-eth/arch/TARGET_RZ_A1H -I{compiler.path}/mbed-lib/EthernetInterface/lwip-sys -I{compiler.path}/mbed-lib/EthernetInterface/lwip-sys/arch -I{compiler.path}/mbed-lib/mbed-rtos -I{compiler.path}/mbed-lib/mbed-rtos/rtos -I{compiler.path}/mbed-lib/mbed-rtos/rtx -I{compiler.path}/mbed-lib/mbed-rtos/rtx/TARGET_CORTEX_A -I{compiler.path}/mbed-lib/mbed-rtos/rtx/TARGET_CORTEX_A/TOOLCHAIN_GCC
compiler.cpp.cmd=bin/arm-none-eabi-g++
compiler.cpp.flags={compiler.c.flags}
compiler.S.cmd=bin/arm-none-eabi-as
compiler.S.flags=-Wall -ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DTESTING=1 -DGRPEACH -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=bin/arm-none-eabi-objcopy
#compiler.c.elf.cmd=bin/arm-none-eabi-ld
compiler.c.elf.cmd={compiler.c.cmd}
compiler.c.elf.flags={cpu}
compiler.ar.cmd=bin/arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.ld.flags=
compiler.size.cmd=bin/arm-none-eabi-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} -std=gnu99 "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {includes} {compiler.cpp.flags} -std=gnu++98 -fno-rtti "{source_file}" -o "{object_file}"

## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.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.c.elf.flags} -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main -Wl,-Map={build.path}/{build.project_name}.map,--cref "-Thardware/arduino/rza1h/variants/gr_peach/{build.ldscript}" -o "{build.path}/{build.project_name}.elf" {object_files} {build.path}/avrlib.c.o {build.path}/Ethernet.cpp.o {build.path}/HardwareSerial.cpp.o {build.path}/IPAddress.cpp.o {build.path}/main.cpp.o {build.path}/MsTimer2.cpp.o {build.path}/new.cpp.o {build.path}/phy.c.o {build.path}/Print.cpp.o {build.path}/r_byteq.c.o {build.path}/r_ether.c.o {build.path}/Stream.cpp.o {build.path}/t4_driver.c.o {build.path}/timer.c.o {build.path}/Tone.cpp.o {build.path}/usbdescriptors.c.o {build.path}/usb_cdc.c.o {build.path}/usb_core.c.o {build.path}/usb_hal.c.o {build.path}/utilities.cpp.o {build.path}/WInterrupts.cpp.o {build.path}/wiring.c.o {build.path}/wiring_analog.cpp.o {build.path}/wiring_digital.cpp.o {build.path}/wiring_private.cpp.o {build.path}/wiring_pulse.cpp.o {build.path}/wiring_shift.cpp.o {build.path}/WMath.cpp.o {build.path}/WString.cpp.o "{build.variant.path}/mbed-lib.a" -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys

## 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=hardware/tools/rx

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