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
17fa9927
Commit
17fa9927
authored
Jan 21, 2013
by
Yukihiro Matz Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
resolve conflicts
parents
117e2ec0
04941bc1
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
9 deletions
+54
-9
minirake
minirake
+2
-2
mrblib/mrblib.rake
mrblib/mrblib.rake
+1
-0
tasks/mrbgem_spec.rake
tasks/mrbgem_spec.rake
+6
-2
tasks/mruby_build_commands.rake
tasks/mruby_build_commands.rake
+19
-3
tasks/ruby_ext.rake
tasks/ruby_ext.rake
+23
-0
tasks/toolchains/vs2012.rake
tasks/toolchains/vs2012.rake
+2
-2
test/mrbtest.rake
test/mrbtest.rake
+1
-0
No files found.
minirake
View file @
17fa9927
...
@@ -277,7 +277,7 @@ module MiniRake
...
@@ -277,7 +277,7 @@ module MiniRake
# Run the system command +cmd+.
# Run the system command +cmd+.
def
sh
(
cmd
)
def
sh
(
cmd
)
puts
cmd
puts
cmd
if
$verbose
system
(
cmd
)
or
fail
"Command Failed: [
#{
cmd
}
]"
system
(
cmd
)
or
fail
"Command Failed: [
#{
cmd
}
]"
end
end
...
@@ -418,7 +418,7 @@ class RakeApp
...
@@ -418,7 +418,7 @@ class RakeApp
# Read and handle the command line options.
# Read and handle the command line options.
def
handle_options
def
handle_options
$verbose
=
tru
e
$verbose
=
fals
e
opts
=
GetoptLong
.
new
(
*
command_line_options
)
opts
=
GetoptLong
.
new
(
*
command_line_options
)
opts
.
each
{
|
opt
,
value
|
do_option
(
opt
,
value
)
}
opts
.
each
{
|
opt
,
value
|
do_option
(
opt
,
value
)
}
end
end
...
...
mrblib/mrblib.rake
View file @
17fa9927
...
@@ -7,6 +7,7 @@ MRuby.each_target do
...
@@ -7,6 +7,7 @@ MRuby.each_target do
mrbc_
,
*
rbfiles
=
t
.
prerequisites
mrbc_
,
*
rbfiles
=
t
.
prerequisites
FileUtils
.
mkdir_p
File
.
dirname
(
t
.
name
)
FileUtils
.
mkdir_p
File
.
dirname
(
t
.
name
)
open
(
t
.
name
,
'w'
)
do
|
f
|
open
(
t
.
name
,
'w'
)
do
|
f
|
_pp
"GEN *.rb >
#{
t
.
name
}
"
f
.
puts
File
.
read
(
"
#{
dir
}
/init_mrblib.c"
)
f
.
puts
File
.
read
(
"
#{
dir
}
/init_mrblib.c"
)
mrbc
.
run
f
,
rbfiles
,
'mrblib_irep'
mrbc
.
run
f
,
rbfiles
,
'mrblib_irep'
end
end
...
...
tasks/mrbgem_spec.rake
View file @
17fa9927
...
@@ -46,11 +46,15 @@ module MRuby
...
@@ -46,11 +46,15 @@ module MRuby
@linker
=
LinkerConfig
.
new
([],
[],
[])
@linker
=
LinkerConfig
.
new
([],
[],
[])
@rbfiles
=
Dir
.
glob
(
"
#{
dir
}
/mrblib/*.rb"
)
@rbfiles
=
Dir
.
glob
(
"
#{
dir
}
/mrblib/*.rb"
)
@objs
=
Dir
.
glob
(
"
#{
dir
}
/src/*.{c,cpp,m,asm,S}"
).
map
{
|
f
|
objfile
(
f
.
relative_path_from
(
@dir
).
to_s
.
pathmap
(
"
#{
build_dir
}
/%X"
))
}
@objs
=
Dir
.
glob
(
"
#{
dir
}
/src/*.{c,cpp,m,asm,S}"
).
map
do
|
f
|
objfile
(
f
.
relative_path_from
(
@dir
).
to_s
.
pathmap
(
"
#{
build_dir
}
/%X"
))
end
@objs
<<
objfile
(
"
#{
build_dir
}
/gem_init"
)
@objs
<<
objfile
(
"
#{
build_dir
}
/gem_init"
)
@test_rbfiles
=
Dir
.
glob
(
"
#{
dir
}
/test/*.rb"
)
@test_rbfiles
=
Dir
.
glob
(
"
#{
dir
}
/test/*.rb"
)
@test_objs
=
Dir
.
glob
(
"
#{
dir
}
/test/*.{c,cpp,m,asm,S}"
).
map
{
|
f
|
objfile
(
f
.
relative_path_from
(
dir
).
to_s
.
pathmap
(
"
#{
build_dir
}
/%X"
))
}
@test_objs
=
Dir
.
glob
(
"
#{
dir
}
/test/*.{c,cpp,m,asm,S}"
).
map
do
|
f
|
objfile
(
f
.
relative_path_from
(
dir
).
to_s
.
pathmap
(
"
#{
build_dir
}
/%X"
))
end
@test_preload
=
'test/assert.rb'
@test_preload
=
'test/assert.rb'
instance_eval
(
&
@initializer
)
instance_eval
(
&
@initializer
)
...
...
tasks/mruby_build_commands.rake
View file @
17fa9927
...
@@ -54,7 +54,13 @@ module MRuby
...
@@ -54,7 +54,13 @@ module MRuby
def
run
(
outfile
,
infile
,
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
def
run
(
outfile
,
infile
,
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
_run
compile_options
,
{
:flags
=>
all_flags
(
_defineds
,
[
_include_paths
,
File
.
dirname
(
infile
)],
_flags
),
:infile
=>
filename
(
infile
),
:outfile
=>
filename
(
outfile
)
}
define_flags
=
[
defines
,
_defineds
].
flatten
.
map
{
|
d
|
option_define
%
d
}
include_path_flags
=
[
include_paths
,
_include_paths
,
File
.
dirname
(
infile
)].
flatten
.
map
do
|
f
|
option_include_path
%
filename
(
f
)
end
_pp
"CC
#{
filename
(
infile
)
}
>
#{
filename
(
outfile
)
}
"
_run
compile_options
,
{
:flags
=>
(
flags
+
define_flags
+
include_path_flags
+
_flags
).
join
(
' '
),
:infile
=>
filename
(
infile
),
:outfile
=>
filename
(
outfile
)
}
end
end
def
define_rules
(
build_dir
,
source_dir
=
''
)
def
define_rules
(
build_dir
,
source_dir
=
''
)
...
@@ -123,7 +129,12 @@ module MRuby
...
@@ -123,7 +129,12 @@ module MRuby
def
run
(
outfile
,
objfiles
,
_libraries
=
[],
_library_paths
=
[],
_flags
=
[])
def
run
(
outfile
,
objfiles
,
_libraries
=
[],
_library_paths
=
[],
_flags
=
[])
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
_run
link_options
,
{
:flags
=>
all_flags
(
_library_paths
,
_flags
),
:outfile
=>
filename
(
outfile
)
,
:objs
=>
filename
(
objfiles
).
join
(
' '
),
:libs
=>
library_flags
(
_libraries
)
}
library_flags
=
[
libraries
,
_libraries
].
flatten
.
reverse
.
map
{
|
d
|
option_library
%
d
}
library_path_flags
=
[
library_paths
,
_library_paths
].
flatten
.
map
{
|
f
|
option_library_path
%
filename
(
f
)
}
_pp
"LD
#{
filename
(
outfile
)
}
"
_run
link_options
,
{
:flags
=>
(
flags
+
library_path_flags
+
_flags
).
join
(
' '
),
:outfile
=>
filename
(
outfile
)
,
:objs
=>
filename
(
objfiles
).
join
(
' '
),
:libs
=>
library_flags
.
join
(
' '
)
}
end
end
end
end
...
@@ -138,6 +149,7 @@ module MRuby
...
@@ -138,6 +149,7 @@ module MRuby
def
run
(
outfile
,
objfiles
)
def
run
(
outfile
,
objfiles
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
_pp
"AR
#{
filename
(
outfile
)
}
"
_run
archive_options
,
{
:outfile
=>
filename
(
outfile
),
:objs
=>
filename
(
objfiles
).
join
(
' '
)
}
_run
archive_options
,
{
:outfile
=>
filename
(
outfile
),
:objs
=>
filename
(
objfiles
).
join
(
' '
)
}
end
end
end
end
...
@@ -153,6 +165,7 @@ module MRuby
...
@@ -153,6 +165,7 @@ module MRuby
def
run
(
outfile
,
infile
)
def
run
(
outfile
,
infile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
_pp
"YACC
#{
filename
(
infile
)
}
>
#{
filename
(
outfile
)
}
"
_run
compile_options
,
{
:outfile
=>
filename
(
outfile
)
,
:infile
=>
filename
(
infile
)
}
_run
compile_options
,
{
:outfile
=>
filename
(
outfile
)
,
:infile
=>
filename
(
infile
)
}
end
end
end
end
...
@@ -168,6 +181,7 @@ module MRuby
...
@@ -168,6 +181,7 @@ module MRuby
def
run
(
outfile
,
infile
)
def
run
(
outfile
,
infile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
_pp
"GPERF
#{
filename
(
infile
)
}
>
#{
filename
(
outfile
)
}
"
_run
compile_options
,
{
:outfile
=>
filename
(
outfile
)
,
:infile
=>
filename
(
infile
)
}
_run
compile_options
,
{
:outfile
=>
filename
(
outfile
)
,
:infile
=>
filename
(
infile
)
}
end
end
end
end
...
@@ -184,6 +198,7 @@ module MRuby
...
@@ -184,6 +198,7 @@ module MRuby
end
end
def
run_clone
(
dir
,
url
,
_flags
=
[])
def
run_clone
(
dir
,
url
,
_flags
=
[])
_pp
"GIT
#{
url
}
>
#{
filename
(
dir
)
}
"
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
url
,
:dir
=>
filename
(
dir
)
}
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
url
,
:dir
=>
filename
(
dir
)
}
end
end
end
end
...
@@ -199,6 +214,7 @@ module MRuby
...
@@ -199,6 +214,7 @@ module MRuby
@command
||=
@build
.
mrbcfile
@command
||=
@build
.
mrbcfile
IO
.
popen
(
"
#{
filename
@command
}
#{
@compile_options
%
{
:funcname
=>
funcname
}
}"
,
'r+'
)
do
|
io
|
IO
.
popen
(
"
#{
filename
@command
}
#{
@compile_options
%
{
:funcname
=>
funcname
}
}"
,
'r+'
)
do
|
io
|
[
infiles
].
flatten
.
each
do
|
f
|
[
infiles
].
flatten
.
each
do
|
f
|
_pp
" MRBC
#{
f
}
"
io
.
write
IO
.
read
(
f
)
io
.
write
IO
.
read
(
f
)
end
end
io
.
close_write
io
.
close_write
...
...
tasks/ruby_ext.rake
View file @
17fa9927
...
@@ -33,3 +33,26 @@ class Symbol
...
@@ -33,3 +33,26 @@ class Symbol
proc
{
|
obj
,
*
args
|
obj
.
send
(
self
,
*
args
)
}
proc
{
|
obj
,
*
args
|
obj
.
send
(
self
,
*
args
)
}
end
end
end
end
$pp_show
=
true
if
$verbose
.
nil?
unless
Rake
.
verbose
.
nil?
if
Rake
.
verbose
.
class
==
TrueClass
# verbose message logging
$pp_show
=
false
else
$pp_show
=
true
Rake
.
verbose
(
false
)
end
else
# could not identify rake version
$pp_show
=
false
end
else
$pp_show
=
false
if
$verbose
end
def
_pp
(
msg
)
puts
msg
if
$pp_show
end
tasks/toolchains/vs2012.rake
View file @
17fa9927
...
@@ -12,8 +12,8 @@ MRuby::Toolchain.new(:vs2012) do |conf|
...
@@ -12,8 +12,8 @@ MRuby::Toolchain.new(:vs2012) do |conf|
conf
.
linker
do
|
linker
|
conf
.
linker
do
|
linker
|
linker
.
command
=
ENV
[
'LD'
]
||
'link.exe'
linker
.
command
=
ENV
[
'LD'
]
||
'link.exe'
linker
.
flags
=
[
ENV
[
'LDFLAGS'
]
||
%w(/nologo)
]
linker
.
flags
=
[
ENV
[
'LDFLAGS'
]
||
%w(/nologo)
]
linkerraries
=
%w(kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32)
linker
.
lib
raries
=
%w(kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32)
linkerrary_paths
=
[]
linker
.
lib
rary_paths
=
[]
linker
.
option_library
=
'-l%s'
linker
.
option_library
=
'-l%s'
linker
.
option_library_path
=
'-L%s'
linker
.
option_library_path
=
'-L%s'
linker
.
link_options
=
"%{flags} /OUT:%{outfile} %{objs} %{libs}"
linker
.
link_options
=
"%{flags} /OUT:%{outfile} %{objs} %{libs}"
...
...
test/mrbtest.rake
View file @
17fa9927
...
@@ -19,6 +19,7 @@ MRuby.each_target do
...
@@ -19,6 +19,7 @@ MRuby.each_target do
file
mlib
=>
[
clib
]
file
mlib
=>
[
clib
]
file
clib
=>
[
mrbcfile
,
init
,
asslib
]
+
mrbs
do
|
t
|
file
clib
=>
[
mrbcfile
,
init
,
asslib
]
+
mrbs
do
|
t
|
_pp
"GEN *.rb >
#{
clib
}
"
open
(
clib
,
'w'
)
do
|
f
|
open
(
clib
,
'w'
)
do
|
f
|
f
.
puts
IO
.
read
(
init
)
f
.
puts
IO
.
read
(
init
)
mrbc
.
run
f
,
[
asslib
]
+
mrbs
,
'mrbtest_irep'
mrbc
.
run
f
,
[
asslib
]
+
mrbs
,
'mrbtest_irep'
...
...
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