This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CIRCUITRUBY_ROOT = File.expand_path "../..", __FILE__ | |
ATMEL_START_DIR = File.join(CIRCUITRUBY_ROOT, "atmel-start-cpx") | |
MRuby::Build.new('host', "#{CIRCUITRUBY_ROOT}/build") do |conf| | |
toolchain :gcc | |
conf.bins =%w(mrbc) | |
end | |
MRuby::CrossBuild.new("arm-none-eabi-cpx", "#{CIRCUITRUBY_ROOT}/build") do |conf| | |
toolchain :gcc | |
conf.cc do |cc| | |
cc.command = "arm-none-eabi-gcc" | |
# Start with mruby parameters for low-memory environments. | |
# From upstream examples/targets/build_config_ArduinoDue.rb | |
cc.defines = %w( | |
MRB_HEAP_PAGE_SIZE=64 | |
KHASH_DEFAULT_SIZE=8 | |
MRB_STR_BUF_MIN_SIZE=20 | |
) | |
cc.defines << %w(MRB_DISABLE_STDIO DISABLE_STDIO) | |
# Controller framework required definitions | |
cc.defines << %w( | |
__SAMD21G18A__ | |
) | |
# CFLAGS from atmel start makefile. | |
cc.flags << %w( | |
-mthumb -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 | |
) | |
# Controller include paths. | |
cc.include_paths << %w( | |
config | |
hal/include | |
hal/utils/include | |
hpl/core | |
hpl/dmac | |
hpl/gclk | |
hpl/pm | |
hpk/port | |
hpl/sysctrl | |
hri | |
CMSIS/Include | |
samd21a/include | |
).map{|inc| File.join(ATMEL_START_DIR, inc) } | |
end | |
conf.bins = [] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment