Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
33350251
Commit
33350251
authored
Jan 09, 2013
by
Yuichiro MASUI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added conf.bins for defining bulding binaries
parent
eab894e5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
30 deletions
+38
-30
Rakefile
Rakefile
+11
-15
build_config.rb
build_config.rb
+2
-0
doc/compile/README.md
doc/compile/README.md
+1
-0
tasks/mruby_build.rake
tasks/mruby_build.rake
+6
-3
tools/mirb/mirb.rake
tools/mirb/mirb.rake
+6
-4
tools/mrbc/mrbc.rake
tools/mrbc/mrbc.rake
+6
-4
tools/mruby/mruby.rake
tools/mruby/mruby.rake
+6
-4
No files found.
Rakefile
View file @
33350251
...
...
@@ -27,25 +27,21 @@ load 'test/mrbtest.rake'
# generic build targets, rules
task
:default
=>
:all
binfiles
=
[
exefile
(
'bin/mruby'
),
exefile
(
'bin/mirb'
),
exefile
(
'bin/mrbc'
)]
desc
"build all targets, install (locally) in-repo"
task
:all
=>
binfiles
+
MRuby
.
targets
.
map
{
|
t
|
[
exefile
(
"
#{
t
.
build_dir
}
/bin/mruby"
),
exefile
(
"
#{
t
.
build_dir
}
/bin/mirb"
),
exefile
(
"
#{
t
.
build_dir
}
/bin/mrbc"
)]
}.
flatten
file
exefile
(
'bin/mruby'
)
=>
exefile
(
'build/host/bin/mruby'
)
do
|
t
|
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
end
binfiles
=
MRuby
.
targets
[
'host'
].
bins
.
map
do
|
bin
|
install_path
=
exefile
(
"bin/
#{
bin
}
"
)
file
install_path
=>
exefile
(
"build/host/bin/
#{
bin
}
"
)
do
|
t
|
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
end
file
exefile
(
'bin/mirb'
)
=>
exefile
(
'build/host/bin/mirb'
)
do
|
t
|
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
install_path
end
file
exefile
(
'bin/mrbc'
)
=>
exefile
(
'build/host/bin/mrbc'
)
do
|
t
|
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
end
desc
"build all targets, install (locally) in-repo"
task
:all
=>
binfiles
+
MRuby
.
targets
.
values
.
map
{
|
t
|
[
exefile
(
"
#{
t
.
build_dir
}
/bin/mruby"
),
exefile
(
"
#{
t
.
build_dir
}
/bin/mirb"
),
exefile
(
"
#{
t
.
build_dir
}
/bin/mrbc"
)]
}.
flatten
desc
"run all mruby tests"
task
:test
=>
MRuby
.
targets
.
map
{
|
t
|
exefile
(
"
#{
t
.
build_dir
}
/test/mrbtest"
)
}
do
task
:test
=>
MRuby
.
targets
.
values
.
map
{
|
t
|
exefile
(
"
#{
t
.
build_dir
}
/test/mrbtest"
)
}
do
sh
"
#{
filename
exefile
(
'build/host/test/mrbtest'
)
}
"
if
MRuby
.
targets
.
count
>
1
puts
"
\n
You should run
#{
MRuby
.
targets
.
map
{
|
t
|
t
.
name
==
'host'
?
nil
:
"
#{
t
.
build_dir
}
/test/mrbtest"
}
.compact.join(', ')} on target device."
...
...
@@ -54,7 +50,7 @@ end
desc
"clean all built and in-repo installed artifacts"
task
:clean
do
MRuby
.
targets
.
each
do
|
t
|
MRuby
.
each_target
do
|
t
|
FileUtils
.
rm_rf
t
.
build_dir
end
FileUtils
.
rm_f
binfiles
...
...
build_config.rb
View file @
33350251
...
...
@@ -2,6 +2,7 @@ MRuby::Build.new do |conf|
conf
.
cc
=
ENV
[
'CC'
]
||
'gcc'
conf
.
ld
=
ENV
[
'LD'
]
||
'gcc'
conf
.
ar
=
ENV
[
'AR'
]
||
'ar'
# conf.bins = %w(mrbc mruby mirb)
# conf.cxx = conf.cc
# conf.objcc = conf.cc
# conf.asm = conf.cc
...
...
@@ -27,6 +28,7 @@ MRuby::CrossBuild.new('i386') do |conf|
conf.cc = ENV['CC'] || 'gcc'
conf.ld = ENV['LD'] || 'gcc'
conf.ar = ENV['AR'] || 'ar'
# conf.bins = %w(mrbc mruby mirb)
# conf.cxx = 'gcc'
# conf.objcc = 'gcc'
# conf.asm = 'gcc'
...
...
doc/compile/README.md
View file @
33350251
...
...
@@ -53,6 +53,7 @@ The following options can be configurated:
*
conf.objccflags (Object compiler flags)
*
conf.asmflags (Assembler flags)
*
conf.gem (A GEM which should be integrated - can be set several times)
*
conf.bins (Build binaries)
To compile just call
```./minirake```
inside of the mruby source root. To
generate the test tool environment call
```./minirake test```
. To clean
...
...
tasks/mruby_build.rake
View file @
33350251
...
...
@@ -3,11 +3,11 @@ module MRuby
attr_accessor
:build
def
targets
@targets
||=
[]
@targets
||=
{}
end
def
each_target
(
&
block
)
@targets
.
each
do
|
target
|
@targets
.
each
do
|
key
,
target
|
target
.
instance_eval
(
&
block
)
end
end
...
...
@@ -22,6 +22,7 @@ module MRuby
attr_writer
:cxx
,
:cxxflags
attr_writer
:objcc
,
:objcflags
attr_writer
:asm
,
:asmflags
attr_accessor
:bins
attr_accessor
:gperf
,
:yacc
attr_accessor
:cat
,
:git
attr_reader
:root
,
:gems
...
...
@@ -38,9 +39,11 @@ module MRuby
@yacc
,
@gperf
=
'bison'
,
'gperf'
@cat
,
@git
=
'cat'
,
'git'
@bins
=
%w(mruby mrbc mirb)
@gems
,
@libmruby
=
[],
[]
MRuby
.
targets
<<
self
MRuby
.
targets
[
name
.
to_s
]
=
self
MRuby
.
build
=
self
instance_eval
(
&
block
)
end
...
...
tools/mirb/mirb.rake
View file @
33350251
dir
=
File
.
dirname
(
__FILE__
).
sub
(
%r|^
\.
/|
,
''
)
MRuby
.
each_target
do
exec
=
exefile
(
"
#{
build_dir
}
/bin/mirb"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
if
bins
.
select
{
|
s
|
s
.
to_s
==
'mirb'
}
exec
=
exefile
(
"
#{
build_dir
}
/bin/mirb"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
gems
.
map
{
|
g
|
g
.
mruby_ldflags
},
gems
.
map
{
|
g
|
g
.
mruby_libs
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
gems
.
map
{
|
g
|
g
.
mruby_ldflags
},
gems
.
map
{
|
g
|
g
.
mruby_libs
}
end
end
end
tools/mrbc/mrbc.rake
View file @
33350251
dir
=
File
.
dirname
(
__FILE__
).
sub
(
%r|^
\.
/|
,
''
)
MRuby
.
each_target
do
exec
=
exefile
(
"
#{
build_dir
}
/bin/mrbc"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
if
bins
.
select
{
|
s
|
s
.
to_s
==
'mrbc'
}
exec
=
exefile
(
"
#{
build_dir
}
/bin/mrbc"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby_core.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
[],
gems
.
map
{
|
g
|
g
.
mruby_libs
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby_core.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
[],
gems
.
map
{
|
g
|
g
.
mruby_libs
}
end
end
end
tools/mruby/mruby.rake
View file @
33350251
dir
=
File
.
dirname
(
__FILE__
).
sub
(
%r|^
\.
/|
,
''
)
MRuby
.
each_target
do
exec
=
exefile
(
"
#{
build_dir
}
/bin/mruby"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
if
bins
.
select
{
|
s
|
s
.
to_s
==
'mruby'
}
exec
=
exefile
(
"
#{
build_dir
}
/bin/mruby"
)
objs
=
Dir
.
glob
(
"
#{
dir
}
/*.{c}"
).
map
{
|
f
|
f
.
pathmap
(
"
#{
build_dir
}
/%X.o"
)
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
gems
.
map
{
|
g
|
g
.
mruby_ldflags
},
gems
.
map
{
|
g
|
g
.
mruby_libs
}
file
exec
=>
objs
+
[
"
#{
build_dir
}
/lib/libmruby.a"
]
do
|
t
|
link
t
.
name
,
t
.
prerequisites
,
gems
.
map
{
|
g
|
g
.
mruby_ldflags
},
gems
.
map
{
|
g
|
g
.
mruby_libs
}
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment