-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_config_ev3rt_sim.rb
157 lines (128 loc) · 5.42 KB
/
build_config_ev3rt_sim.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Usage: MRUBY_CONFIG=build_config_ev3rt.rb rake
#
#
# User Configuration
#
EV3RT_PATH = "ev3rt-athrill-v850e2m のパスをここに書く"
GNU_TOOL_PREFX = "(環境に合わせてパスを追加)/athrill-gcc/bin/v850-elf-"
##GNU_TOOL_PREFX = "arm-none-eabi-"
#
# mruby Build Tasks
#
MRuby::Build.new do |conf|
# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
enable_debug
# include the default GEMs
conf.gembox 'default'
end
# Cross Compiling configuration for EV3RT
# http://dev.toppers.jp/trac_user/ev3pf/wiki/WhatsEV3RT (in Japanese)
#
MRuby::CrossBuild.new("EV3RT-sim") do |conf|
toolchain :gcc
EV3_RT_INCLUDES = %w(include
arch
target/v850_gcc
target/v850_gcc/api
target/v850_gcc/api/include
target/v850_gcc/dmloader/app/include
target/v850_gcc/dmloader/include
target/v850_gcc/drivers/bluetooth/btstack/include
target/v850_gcc/drivers/soc/AM1808_StarterWare_1_00_03_03/include/hw
target/v850_gcc/drivers/bluetooth/include
target/v850_gcc/drivers/brick/include
target/v850_gcc/drivers/common/include
target/v850_gcc/drivers/common/virtual-linux-kernel/arch/arm/include
target/v850_gcc/drivers/common/virtual-linux-kernel/include
target/v850_gcc/drivers/console/include
target/v850_gcc/drivers/fatfs/include
target/v850_gcc/drivers/gpio/include
target/v850_gcc/drivers/lcd/include
target/v850_gcc/drivers/lcd/linux/include
target/v850_gcc/drivers/linux/arch/arm/include
target/v850_gcc/drivers/linux/arch/arm/mach-davinci/include
target/v850_gcc/drivers/linux/include
target/v850_gcc/drivers/motor/include
target/v850_gcc/drivers/newlib/include
target/v850_gcc/drivers/sensor/analog/include
target/v850_gcc/drivers/sensor/uart/d_uart/Linuxmod_AM1808/pru-firmware-05-31-2011-1423-v3.0/pru/hal/common/include
target/v850_gcc/drivers/sensor/uart/d_uart/Linuxmod_AM1808/pru-firmware-05-31-2011-1423-v3.0/pru/hal/uart/include
target/v850_gcc/drivers/sensor/uart/include
target/v850_gcc/drivers/soc/AM1808_StarterWare_1_00_03_03/include
target/v850_gcc/drivers/soc/include
target/v850_gcc/drivers/sound/include
target/v850_gcc/kernel_mod/include
target/v850_gcc/pil/include
target/v850_gcc/platform/include
target/v850_gcc/TLSF-2.4.6/include
sdk/common/ev3api/include
syssvc
arch/arm_gcc/am1808
arch/arm_gcc/common
arch/gcc
arch/v850_gcc
. )
conf.cc do |cc|
cc.command = "#{GNU_TOOL_PREFX}gcc"
cc.include_paths << EV3_RT_INCLUDES.map{|inc| File.join(EV3RT_PATH, inc)}
cc.include_paths << File.join('$ETROBO_HRP3_WORKSPACE', 'etroboc_common')
cc.flags = %w(-std=gnu99 -Dgcc -mv850e2v3 -nostdlib
-Wall -DBUILD_EV3_PLATFORM -DCONFIG_FB_DEFERRED_IO
-D__KERNEL__ -D__TARGET_ARCH_ARM=5 -DTOPPERS_CFG1_OUT -DTOPPERS_EV3 -DSIM)
cc.flags << %w(-O3)
##cc.flags << %w(-Os)
# cc.flags << %w(-g3)
##cc.flags << %w(DUSE_CFG_PASS3)
cc.compile_options = "%{flags} -o %{outfile} -c %{infile}"
cc.defines << %w(MRB_DISABLE_STDIO) #if you dont need stdio.
#cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval
end
conf.cxx do |cxx|
cc = conf.cc
cxx.command = cc.command.dup
cxx.include_paths = cc.include_paths.dup
cxx.flags = cc.flags.dup
cxx.flags << %w(-fno-rtti -fno-exceptions)
cxx.defines = cc.defines.dup
cxx.compile_options = cc.compile_options.dup
end
conf.archiver do |archiver|
archiver.command = "#{GNU_TOOL_PREFX}ar"
# archiver.archive_options = 'rcs %{outfile} %{objs}'
end
#no executables
conf.bins = []
#do not build executable test
conf.build_mrbtest_lib_only
#disable C++ exception
conf.disable_cxx_exception
#gems from core
#conf.gem :core => "mruby-sprintf"
#conf.gem :core => "mruby-print"
# conf.gem :core => "mruby-math"
#conf.gem :core => "mruby-time"
#conf.gem :core => "mruby-struct"
#conf.gem :core => "mruby-enum-ext"
conf.gem :core => "mruby-string-ext"
#conf.gem :core => "mruby-numeric-ext"
#conf.gem :core => "mruby-array-ext"
#conf.gem :core => "mruby-hash-ext"
#conf.gem :core => "mruby-range-ext"
#conf.gem :core => "mruby-proc-ext"
#conf.gem :core => "mruby-symbol-ext"
#conf.gem :core => "mruby-random"
#conf.gem :core => "mruby-object-ext"
conf.gem :core => "mruby-compiler"
#conf.gem "mrbgems/mruby-ev3rt"
# conf.gembox 'default'
conf.gem "../mruby-ev3rt"
#conf.gem :github => "yamanekko/mruby-ev3rt-io"
# conf.gem :github => "yamanekko/mruby-ev3rt"
#light-weight regular expression
#conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master"
end