[281] | 1 | MRuby::Toolchain.new(:ca850) do |conf|
|
---|
| 2 | [conf.cc, conf.cxx].each do |cc|
|
---|
| 3 | cc.command = ENV['CC'] || 'ca850.exe'
|
---|
| 4 | cc.flags = [ENV['CFLAGS'] || %w(-c -g -Xcxxcom -Xdefvar -Xpro_epi_runtime=off)]
|
---|
| 5 | cc.include_paths = ["#{MRUBY_ROOT}\\include", "#{MRUBY_ROOT}\\..\\csp\\ca850"]
|
---|
| 6 | cc.defines = %w(DISABLE_GEMS)
|
---|
| 7 | cc.option_include_path = '-I%s'
|
---|
| 8 | cc.option_define = '-D%s'
|
---|
| 9 | cc.compile_options = "-cpu f3783 \"-devpath=#{DEVICE_FILE_PATH}\" %{infile} -o %{outfile} %{flags}"
|
---|
| 10 | end
|
---|
| 11 |
|
---|
| 12 | conf.linker do |linker|
|
---|
| 13 | linker.command = ENV['LD'] || 'ld850.exe'
|
---|
| 14 | linker.flags = [ENV['LDFLAGS']]
|
---|
| 15 | linker.flags_before_libraries = '-Xsid=0xffffffffffffffffffff -rc'
|
---|
| 16 | linker.libraries = %w(m c r)
|
---|
| 17 | linker.library_paths = ["#{LIBRARIES_PATH}"]
|
---|
| 18 | linker.option_library = '-l%s'
|
---|
| 19 | linker.option_library_path = '-L%s'
|
---|
| 20 | linker.link_options = "-cpu f3783 -F \"#{DEVICE_FILE_PATH}\" %{objs} -o %{outfile} %{flags} %{flags_before_libraries} %{libs} %{flags_after_libraries}"
|
---|
| 21 | end
|
---|
| 22 |
|
---|
| 23 | conf.archiver do |archiver|
|
---|
| 24 | archiver.command = ENV['AR'] || 'ar850.exe'
|
---|
| 25 | archiver.archive_options = 'q %{outfile} %{objs}'
|
---|
| 26 | end
|
---|
| 27 |
|
---|
| 28 | conf.yacc do |yacc|
|
---|
| 29 | yacc.command = ENV['YACC'] || 'bison.exe'
|
---|
| 30 | yacc.compile_options = '-o %{outfile} %{infile}'
|
---|
| 31 | end
|
---|
| 32 |
|
---|
| 33 | conf.gperf do |gperf|
|
---|
| 34 | gperf.command = 'gperf.exe'
|
---|
| 35 | gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
|
---|
| 36 | end
|
---|
| 37 |
|
---|
| 38 | conf.exts do |exts|
|
---|
| 39 | exts.object = '.o'
|
---|
| 40 | exts.executable = '.out'
|
---|
| 41 | exts.library = '.a'
|
---|
| 42 | end
|
---|
| 43 |
|
---|
| 44 | conf.file_separator = '\\'
|
---|
| 45 | end
|
---|