
# X86 compile variables
# ---------------------

name=Arduino X86 Boards
# compiler.path TBD
compiler.toolchain.path={runtime.ide.path}/hardware/tools/edison
compiler.install.cmd=tools/edison/install_script.sh
compiler.path={compiler.toolchain.path}/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/
compiler.sysroot={compiler.toolchain.path}/sysroots/core2-32-poky-linux
compiler.c.cmd={build.toolchain_prefix}gcc
compiler.c.flags= -m32 -march=i586 "--sysroot={compiler.sysroot}" -c -g -Os -w -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__
compiler.c.elf.flags=-m32 -march=i586 "--sysroot={compiler.sysroot}" -Os -Wl,--gc-sections
compiler.c.elf.cmd={build.toolchain_prefix}g++
compiler.S.flags=-c -g -assembler-with-cpp
compiler.cpp.cmd={build.toolchain_prefix}g++
compiler.cpp.flags= -m32 -march=i586 "--sysroot={compiler.sysroot}" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__
compiler.ar.cmd={build.toolchain_prefix}ar
compiler.ar.flags=rcs
compiler.objcopy.cmd={build.toolchain_prefix}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 ihex -R .eeprom
compiler.elf2hex.cmd={build.toolchain_prefix}objcopy
compiler.ldflags=
compiler.size.cmd={build.toolchain_prefix}size
compiler.strip.cmd={build.toolchain_prefix}strip
# this can be overriden in boards.txt
build.extra_flags=

# X86 compile patterns
# --------------------

## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -march={build.mcu} {build.f_cpu} -D{software}={runtime.ide.version} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -march={build.mcu} {build.f_cpu} -D{software}={runtime.ide.version} {build.extra_flags} {includes} "{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} -march={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm -lpthread

## Create eeprom
recipe.objcopy.eep.pattern="{compiler.path}{compiler.strip.cmd}" "{build.path}/{build.project_name}.elf"

## Create hex
recipe.objcopy.hex.pattern=

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=Total\s+([0-9]+).*


# X86 Uploader/Programmers tools
# -------------------

tools.izmirdl.cmd.path="{runtime.ide.path}/hardware/arduino/edison/tools/izmir/clupload_linux.sh"

tools.izmirdl.upload.params.verbose=-vvvvvv
tools.izmirdl.upload.params.quiet=-q

tools.izmirdl.upload.pattern=/bin/bash --verbose  --noprofile {cmd.path} "{runtime.ide.path}/hardware/tools" {build.path}/{build.project_name}.elf {serial.port}

