1 | MRuby::Build.new do |conf|
|
---|
2 | # load specific toolchain settings
|
---|
3 |
|
---|
4 | # Gets set by the VS command prompts.
|
---|
5 | if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
6 | toolchain :visualcpp
|
---|
7 | else
|
---|
8 | toolchain :gcc
|
---|
9 | end
|
---|
10 |
|
---|
11 | enable_debug
|
---|
12 |
|
---|
13 | # Use mrbgems
|
---|
14 | # conf.gem 'examples/mrbgems/ruby_extension_example'
|
---|
15 | # conf.gem 'examples/mrbgems/c_extension_example' do |g|
|
---|
16 | # g.cc.flags << '-g' # append cflags in this gem
|
---|
17 | # end
|
---|
18 | # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
|
---|
19 | # conf.gem :github => 'masuidrive/mrbgems-example', :checksum_hash => '76518e8aecd131d047378448ac8055fa29d974a9'
|
---|
20 | # conf.gem :git => 'git@github.com:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v'
|
---|
21 |
|
---|
22 | # include the default GEMs
|
---|
23 | conf.gembox 'default'
|
---|
24 | # C compiler settings
|
---|
25 | # conf.cc do |cc|
|
---|
26 | # cc.command = ENV['CC'] || 'gcc'
|
---|
27 | # cc.flags = [ENV['CFLAGS'] || %w()]
|
---|
28 | # cc.include_paths = ["#{root}/include"]
|
---|
29 | # cc.defines = %w(DISABLE_GEMS)
|
---|
30 | # cc.option_include_path = '-I%s'
|
---|
31 | # cc.option_define = '-D%s'
|
---|
32 | # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
|
---|
33 | # end
|
---|
34 |
|
---|
35 | # mrbc settings
|
---|
36 | # conf.mrbc do |mrbc|
|
---|
37 | # mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers
|
---|
38 | # end
|
---|
39 |
|
---|
40 | # Linker settings
|
---|
41 | # conf.linker do |linker|
|
---|
42 | # linker.command = ENV['LD'] || 'gcc'
|
---|
43 | # linker.flags = [ENV['LDFLAGS'] || []]
|
---|
44 | # linker.flags_before_libraries = []
|
---|
45 | # linker.libraries = %w()
|
---|
46 | # linker.flags_after_libraries = []
|
---|
47 | # linker.library_paths = []
|
---|
48 | # linker.option_library = '-l%s'
|
---|
49 | # linker.option_library_path = '-L%s'
|
---|
50 | # linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
|
---|
51 | # end
|
---|
52 |
|
---|
53 | # Archiver settings
|
---|
54 | # conf.archiver do |archiver|
|
---|
55 | # archiver.command = ENV['AR'] || 'ar'
|
---|
56 | # archiver.archive_options = 'rs %{outfile} %{objs}'
|
---|
57 | # end
|
---|
58 |
|
---|
59 | # Parser generator settings
|
---|
60 | # conf.yacc do |yacc|
|
---|
61 | # yacc.command = ENV['YACC'] || 'bison'
|
---|
62 | # yacc.compile_options = '-o %{outfile} %{infile}'
|
---|
63 | # end
|
---|
64 |
|
---|
65 | # gperf settings
|
---|
66 | # conf.gperf do |gperf|
|
---|
67 | # gperf.command = 'gperf'
|
---|
68 | # gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
|
---|
69 | # end
|
---|
70 |
|
---|
71 | # file extensions
|
---|
72 | # conf.exts do |exts|
|
---|
73 | # exts.object = '.o'
|
---|
74 | # exts.executable = '' # '.exe' if Windows
|
---|
75 | # exts.library = '.a'
|
---|
76 | # end
|
---|
77 |
|
---|
78 | # file separetor
|
---|
79 | # conf.file_separator = '/'
|
---|
80 |
|
---|
81 | # bintest
|
---|
82 | # conf.enable_bintest
|
---|
83 | end
|
---|
84 |
|
---|
85 | MRuby::Build.new('host-debug') do |conf|
|
---|
86 | # load specific toolchain settings
|
---|
87 |
|
---|
88 | # Gets set by the VS command prompts.
|
---|
89 | if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
90 | toolchain :visualcpp
|
---|
91 | else
|
---|
92 | toolchain :gcc
|
---|
93 | end
|
---|
94 |
|
---|
95 | enable_debug
|
---|
96 |
|
---|
97 | # include the default GEMs
|
---|
98 | conf.gembox 'default'
|
---|
99 |
|
---|
100 | # C compiler settings
|
---|
101 | conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
|
---|
102 |
|
---|
103 | # Generate mruby debugger command (require mruby-eval)
|
---|
104 | conf.gem :core => "mruby-bin-debugger"
|
---|
105 |
|
---|
106 | # bintest
|
---|
107 | # conf.enable_bintest
|
---|
108 | end
|
---|
109 |
|
---|
110 | #MRuby::Build.new('test') do |conf|
|
---|
111 | # # Gets set by the VS command prompts.
|
---|
112 | # if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
113 | # toolchain :visualcpp
|
---|
114 | # else
|
---|
115 | # toolchain :gcc
|
---|
116 | # end
|
---|
117 | #
|
---|
118 | # enable_debug
|
---|
119 | # conf.enable_bintest
|
---|
120 | # conf.enable_test
|
---|
121 | #
|
---|
122 | # conf.gembox 'default'
|
---|
123 | #end
|
---|
124 |
|
---|
125 | # Define cross build settings
|
---|
126 | # MRuby::CrossBuild.new('32bit') do |conf|
|
---|
127 | # toolchain :gcc
|
---|
128 | #
|
---|
129 | # conf.cc.flags << "-m32"
|
---|
130 | # conf.linker.flags << "-m32"
|
---|
131 | #
|
---|
132 | # conf.build_mrbtest_lib_only
|
---|
133 | #
|
---|
134 | # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
|
---|
135 | #
|
---|
136 | # conf.test_runner.command = 'env'
|
---|
137 | #
|
---|
138 | # end
|
---|
139 |
|
---|
140 | # Define cross build settings
|
---|
141 | MRuby::CrossBuild.new('arm-none-eabi') do |conf|
|
---|
142 | toolchain :gcc
|
---|
143 |
|
---|
144 | conf.cc.command = "arm-none-eabi-gcc"
|
---|
145 | conf.cxx.command = "arm-none-eabi-g++"
|
---|
146 | conf.linker.command = "arm-none-eabi-gcc"
|
---|
147 | conf.archiver.command = "arm-none-eabi-ar"
|
---|
148 |
|
---|
149 | conf.cc.flags << %w(-MD -MP -mlittle-endian -mcpu=cortex-a9 -mthumb -mthumb-interwork -marm -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -mno-unaligned-access -fno-strict-aliasing)
|
---|
150 |
|
---|
151 | #configuration for low memory environment
|
---|
152 | conf.cc.defines << %w(MRB_GC_STRESS)
|
---|
153 | #conf.cc.defines << %w(DISABLE_STDIO)
|
---|
154 | conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
|
---|
155 |
|
---|
156 | conf.build_mrbtest_lib_only
|
---|
157 |
|
---|
158 | conf.gem "#{root}/mrbgems/mruby-compiler"
|
---|
159 | conf.gem "#{root}/mrbgems/mruby-numeric-ext"
|
---|
160 | conf.gem "#{root}/mrbgems/mruby-string-ext"
|
---|
161 | conf.gem '../mrbgems/mruby-onig-regexp' do |g|
|
---|
162 | g.cc.include_paths << "../onigmo-5.15.0/src"
|
---|
163 | end
|
---|
164 | conf.gem "#{root}/../mrbgems/mruby-blockly"
|
---|
165 | conf.gem "#{root}/../mrbgems/mruby-io"
|
---|
166 | conf.gem "#{root}/../mrbgems/mruby-dir" do |g|
|
---|
167 | g.cc.defines = %w(__NEWLIB__=2)
|
---|
168 | g.cc.include_paths << "#{g.dir}/../../musl-1.1.12/include"
|
---|
169 | end
|
---|
170 | conf.gem "#{root}/../mrbgems/mruby-pack"
|
---|
171 | conf.gem "#{root}/../mrbgems/mruby-socket" do |g|
|
---|
172 | g.cc.include_paths << "#{g.dir}/../../musl-1.1.12/include"
|
---|
173 | end
|
---|
174 | conf.gem "#{root}/../mrbgems/mruby-arduino" do |g|
|
---|
175 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/api"
|
---|
176 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/hal"
|
---|
177 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/cmsis"
|
---|
178 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H"
|
---|
179 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc"
|
---|
180 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/inc/iodefines"
|
---|
181 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H"
|
---|
182 | g.cc.include_paths << "#{g.dir}/../../asp3_dcre/mbed/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/TARGET_MBED_MBRZA1H"
|
---|
183 | g.cc.include_paths << "#{g.dir}/../../sample/gr_peach"
|
---|
184 | g.cc.include_paths << "#{g.dir}/../../prototool/src"
|
---|
185 | end
|
---|
186 | conf.gem "#{root}/../mrbgems/mruby-ecnl"
|
---|
187 | conf.gem "#{root}/../mrbgems/mruby-others"
|
---|
188 |
|
---|
189 | conf.bins = []
|
---|
190 |
|
---|
191 | # conf.test_runner.command = 'env'
|
---|
192 | end
|
---|
193 | =begin
|
---|
194 | MRuby::CrossBuild.new("emscripten") do |conf|
|
---|
195 | toolchain :emscripten
|
---|
196 |
|
---|
197 | conf.archiver.command = "llvm-ar"
|
---|
198 | conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins'
|
---|
199 | #conf.linker.flags << '-s BINARYEN=1'
|
---|
200 | #conf.exts.executable = '.html'
|
---|
201 |
|
---|
202 | # include the default GEMs
|
---|
203 | conf.gembox 'default'
|
---|
204 | conf.gem :core => 'mruby-bin-mrbc'
|
---|
205 | end
|
---|
206 | =end
|
---|