
The virtual hardware is among other purposses meant to be used for debugging firmware issues. The flag -Os optimizes out specific information that makes proper debugging difficult in some situations. Also, the virtual hardware does not come with restrictions in terms of PROGMEM. That's why space efficiency is not needed there. Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
148 lines
7.3 KiB
Plaintext
148 lines
7.3 KiB
Plaintext
|
|
# For more info:
|
|
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
|
|
|
|
name=Keyboardio Keyboards
|
|
version=1.6.11
|
|
|
|
# This file is for "virtual" hardware which means we compile the sketch for
|
|
# x86, and with an entirely different core.
|
|
|
|
compiler.warning_flags=-w
|
|
compiler.warning_flags.none=-w
|
|
compiler.warning_flags.default=
|
|
compiler.warning_flags.more=-Wall
|
|
compiler.warning_flags.all=-Wall -Wextra
|
|
|
|
compiler.path=
|
|
compiler.c.cmd=gcc
|
|
compiler.c.flags=-c -g {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD
|
|
compiler.c.elf.flags={compiler.warning_flags} -Wl,--gc-sections
|
|
compiler.c.elf.flags_join_archives=rcT
|
|
compiler.c.elf.cmd=g++
|
|
compiler.S.flags=-c -g -x assembler-with-cpp
|
|
compiler.cpp.cmd=g++
|
|
compiler.cpp.flags=-c -g {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -DARDUINO_VIRTUAL=1 -DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Virtual.h" -DUSBCON=dummy -DARDUINO_ARCH_AVR=1
|
|
compiler.ar.cmd=ar
|
|
compiler.ar.flags=rcs
|
|
compiler.objcopy.cmd=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=objcopy
|
|
compiler.ldflags=
|
|
compiler.size.cmd=echo >/dev/null
|
|
|
|
# This can be overridden in boards.txt
|
|
build.extra_flags=
|
|
|
|
# These can be overridden in platform.local.txt
|
|
compiler.c.extra_flags=-Wno-unused-parameter -Wno-unused-variable -Wno-type-limits
|
|
compiler.c.elf.extra_flags=
|
|
compiler.S.extra_flags=
|
|
compiler.cpp.extra_flags=-Woverloaded-virtual -Wno-unused-parameter -Wno-unused-variable -Wno-type-limits
|
|
compiler.ar.extra_flags=
|
|
compiler.objcopy.eep.extra_flags=
|
|
compiler.elf2hex.extra_flags=
|
|
|
|
# AVR compile patterns
|
|
# --------------------
|
|
|
|
## Compile c files
|
|
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.usb_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
|
|
## Compile c++ files
|
|
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.usb_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
|
|
## Compile S files
|
|
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.usb_flags} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
|
|
## Create archives
|
|
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
|
|
archive_file_path={build.path}/{archive_file}
|
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
|
|
|
################################################################################
|
|
## PLEASE NOTE: The way we link our elf binary significantly differs from the
|
|
## way that Arduino handles things by default.
|
|
## The original linker command has been split up into three
|
|
## steps (recipe.c.combine.pattern, recipe.hooks.linking.postlink.1.pattern
|
|
## and recipe.hooks.linking.postlink.2.pattern).
|
|
## This is necessary to prevent link errors reporting unresolved symbols
|
|
## due to order dependencies of libraries and objects appearing
|
|
## in the linker command line.
|
|
##
|
|
## CHANGED WRT DEFAULT: Generate a large .a archive to prevent link order issues with garbage collection
|
|
recipe.c.combine.pattern="{compiler.path}/{compiler.ar.cmd}" {compiler.c.elf.flags_join_archives} "{build.path}/{build.project_name}_joined.a" {object_files} "{build.path}/{archive_file}"
|
|
##
|
|
## NEWLY INTRODUCED: Link with global garbage collection (considering all
|
|
## objects and libraries together).
|
|
recipe.hooks.linking.postlink.1.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}_joined.a" "-L{build.path}" -lm
|
|
##
|
|
## NEWLY INTRODUCED: Removing the joined library is required to avoid malformed archives that
|
|
## would otherwise result when updating a pre-existing
|
|
## joined archive file during a subsequent firmware build.
|
|
##
|
|
recipe.hooks.linking.postlink.2.pattern={tools.rm.cmd} "{build.path}/{build.project_name}_joined.a"
|
|
################################################################################
|
|
|
|
# Run the test executable as a build step
|
|
#
|
|
recipe.hooks.linking.postlink.3.pattern="{build.path}/{build.project_name}.elf" -t
|
|
|
|
## Create output files (.eep and .hex)
|
|
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
|
|
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
|
|
|
|
## Save hex
|
|
recipe.output.tmp_file={build.project_name}.hex
|
|
recipe.output.save_file={build.project_name}.{build.variant}.hex
|
|
|
|
## Compute size
|
|
recipe.size.pattern=echo "[size not computed for virtual build]"
|
|
recipe.size.regex=^.*
|
|
recipe.size.regex.data=^.*
|
|
recipe.size.regex.eeprom=^.*
|
|
|
|
## Preprocessor
|
|
preproc.includes.flags=-w -x c++ -M -MG -MP
|
|
recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.usb_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"
|
|
|
|
preproc.macros.flags=-w -x c++ -E -CC
|
|
recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.usb_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
|
|
|
|
# AVR Uploader/Programmers tools
|
|
# ------------------------------
|
|
|
|
tools.avrdude.path={runtime.tools.avrdude.path}
|
|
tools.avrdude.cmd.path={path}/bin/avrdude
|
|
tools.avrdude.config.path={path}/etc/avrdude.conf
|
|
|
|
tools.avrdude.upload.params.verbose=-v
|
|
tools.avrdude.upload.params.quiet=-q -q
|
|
tools.avrdude.upload.params.noverify=-V
|
|
tools.avrdude.upload.pattern=
|
|
|
|
tools.avrdude.program.params.verbose=-v
|
|
tools.avrdude.program.params.quiet=-q -q
|
|
tools.avrdude.program.params.noverify=-V
|
|
tools.avrdude.program.pattern=
|
|
|
|
tools.avrdude.erase.params.verbose=-v
|
|
tools.avrdude.erase.params.quiet=-q -q
|
|
tools.avrdude.erase.pattern=
|
|
|
|
tools.avrdude.bootloader.params.verbose=-v
|
|
tools.avrdude.bootloader.params.quiet=-q -q
|
|
tools.avrdude.bootloader.pattern=
|
|
|
|
tools.avrdude_remote.upload.pattern=
|
|
|
|
tools.rm.cmd=rm -f
|
|
tools.rm.cmd.windows=powershell.exe Remove-Item -LiteralPath
|
|
|
|
# USB Default Flags
|
|
# Default blank usb manufacturer will be filled in at compile time
|
|
# - from numeric vendor ID, set to Unknown otherwise
|
|
build.usb_manufacturer="Unknown"
|
|
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|