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

name=Arduino X86 Boards
# compiler.path TBD
 compiler.install.cmd=tools/install_script.sh
compiler.path={runtime.ide.path}/hardware/tools/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/
compiler.c.cmd=i586-poky-linux-uclibc-gcc
compiler.c.flags= -m32 -march=i586 "--sysroot={runtime.ide.path}/hardware/tools/sysroots/i586-poky-linux-uclibc" -c -g -Os -w -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -Xassembler -mquark-strip-lock=yes
compiler.c.elf.flags=-m32 -march=i586 "--sysroot={runtime.ide.path}/hardware/tools/sysroots/i586-poky-linux-uclibc" -Os -Wl,--gc-sections
compiler.c.elf.cmd=i586-poky-linux-uclibc-g++
compiler.S.flags=-c -g -assembler-with-cpp
compiler.cpp.cmd=i586-poky-linux-uclibc-g++
compiler.cpp.flags= -m32 -march=i586 "--sysroot={runtime.ide.path}/hardware/tools/sysroots/i586-poky-linux-uclibc" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -Xassembler -mquark-strip-lock=yes
compiler.ar.cmd=i586-poky-linux-uclibc-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=i586-poky-linux-uclibc-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=i586-poky-linux-uclibc-objcopy
compiler.ldflags=
compiler.size.cmd=i586-poky-linux-uclibc-size
compiler.strip.cmd=i586-poky-linux-uclibc-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/x86/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}

