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
24679c6d
Commit
24679c6d
authored
Jan 30, 2013
by
Yukihiro Matz Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
resolve conflict
parents
78b362f8
6440f108
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
43 deletions
+56
-43
Rakefile
Rakefile
+12
-3
build_config.rb
build_config.rb
+1
-1
tasks/mrbgem_spec.rake
tasks/mrbgem_spec.rake
+0
-1
tasks/mrbgems.rake
tasks/mrbgems.rake
+1
-1
tasks/mruby_build.rake
tasks/mruby_build.rake
+37
-32
tasks/mruby_build_commands.rake
tasks/mruby_build_commands.rake
+3
-3
tasks/toolchains/clang.rake
tasks/toolchains/clang.rake
+1
-1
tasks/toolchains/gcc.rake
tasks/toolchains/gcc.rake
+1
-1
No files found.
Rakefile
View file @
24679c6d
...
@@ -8,8 +8,17 @@ load 'tasks/mrbgem_spec.rake'
...
@@ -8,8 +8,17 @@ load 'tasks/mrbgem_spec.rake'
##############################
##############################
# compile flags
# compile flags
MRUBY_CONFIG
=
File
.
expand_path
(
ENV
[
'MRUBY_CONFIG'
]
||
'./build_config.rb'
)
load
'build_config.rb'
load
MRUBY_CONFIG
MRUBY_CONFIGS
=
[
'build_config.rb'
]
if
ENV
[
'MRUBY_CONFIG'
]
MRUBY_CONFIGS
<<
ENV
[
'MRUBY_CONFIG'
]
load
ENV
[
'MRUBY_CONFIG'
]
end
MRuby
.
each_target
do
|
build
|
build
.
define_rules
end
load
'src/mruby_core.rake'
load
'src/mruby_core.rake'
load
'mrblib/mrblib.rake'
load
'mrblib/mrblib.rake'
...
@@ -34,7 +43,7 @@ depfiles = MRuby.targets['host'].bins.map do |bin|
...
@@ -34,7 +43,7 @@ depfiles = MRuby.targets['host'].bins.map do |bin|
FileUtils
.
rm
t
.
name
,
:force
=>
true
FileUtils
.
rm
t
.
name
,
:force
=>
true
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
FileUtils
.
cp
t
.
prerequisites
.
first
,
t
.
name
end
end
install_path
install_path
end
end
...
...
build_config.rb
View file @
24679c6d
...
@@ -74,5 +74,5 @@ end
...
@@ -74,5 +74,5 @@ end
# conf.cc.flags << "-m32"
# conf.cc.flags << "-m32"
# conf.linker.flags << "-m32"
# conf.linker.flags << "-m32"
#
#
# conf.gem '
examples
/mrbgems/c_and_ruby_extension_example'
# conf.gem '
doc
/mrbgems/c_and_ruby_extension_example'
# end
# end
tasks/mrbgem_spec.rake
View file @
24679c6d
...
@@ -35,7 +35,6 @@ module MRuby
...
@@ -35,7 +35,6 @@ module MRuby
def
setup
def
setup
MRuby
::
Gem
.
current
=
self
MRuby
::
Gem
.
current
=
self
@build
.
compilers
.
each
do
|
compiler
|
@build
.
compilers
.
each
do
|
compiler
|
compiler
.
include_paths
<<
"
#{
dir
}
/include"
compiler
.
include_paths
<<
"
#{
dir
}
/include"
end
end
...
...
tasks/mrbgems.rake
View file @
24679c6d
...
@@ -8,7 +8,7 @@ MRuby.each_target do
...
@@ -8,7 +8,7 @@ MRuby.each_target do
# loader all gems
# loader all gems
self
.
libmruby
<<
objfile
(
"
#{
build_dir
}
/mrbgems/gem_init"
)
self
.
libmruby
<<
objfile
(
"
#{
build_dir
}
/mrbgems/gem_init"
)
file
objfile
(
"
#{
build_dir
}
/mrbgems/gem_init"
)
=>
"
#{
build_dir
}
/mrbgems/gem_init.c"
file
objfile
(
"
#{
build_dir
}
/mrbgems/gem_init"
)
=>
"
#{
build_dir
}
/mrbgems/gem_init.c"
file
"
#{
build_dir
}
/mrbgems/gem_init.c"
=>
[
MRUBY_CONFIG
]
do
|
t
|
file
"
#{
build_dir
}
/mrbgems/gem_init.c"
=>
[
MRUBY_CONFIG
S
].
flatten
do
|
t
|
FileUtils
.
mkdir_p
"
#{
build_dir
}
/mrbgems"
FileUtils
.
mkdir_p
"
#{
build_dir
}
/mrbgems"
open
(
t
.
name
,
'w'
)
do
|
f
|
open
(
t
.
name
,
'w'
)
do
|
f
|
f
.
puts
%Q[/*]
f
.
puts
%Q[/*]
...
...
tasks/mruby_build.rake
View file @
24679c6d
...
@@ -53,43 +53,37 @@ module MRuby
...
@@ -53,43 +53,37 @@ module MRuby
Exts
=
Struct
.
new
(
:object
,
:executable
,
:library
)
Exts
=
Struct
.
new
(
:object
,
:executable
,
:library
)
def
initialize
(
name
=
'host'
,
&
block
)
def
initialize
(
name
=
'host'
,
&
block
)
MRuby
::
Build
.
current
=
self
@name
=
name
.
to_s
@name
=
name
@root
=
File
.
expand_path
(
"
#{
File
.
dirname
(
__FILE__
)
}
/.."
)
if
ENV
[
'OS'
]
==
'Windows_NT'
unless
MRuby
.
targets
[
@name
]
@exts
=
Exts
.
new
(
'.o'
,
'.exe'
,
'.a'
)
@root
=
File
.
expand_path
(
"
#{
File
.
dirname
(
__FILE__
)
}
/.."
)
else
@exts
=
Exts
.
new
(
'.o'
,
''
,
'.a'
)
end
@file_separator
=
'/'
@cc
=
Command
::
Compiler
.
new
(
self
,
%w(.c)
)
@cxx
=
Command
::
Compiler
.
new
(
self
,
%w(.cc .cxx .cpp)
)
@objc
=
Command
::
Compiler
.
new
(
self
,
%w(.m)
)
@asm
=
Command
::
Compiler
.
new
(
self
,
%w(.S .asm)
)
@linker
=
Command
::
Linker
.
new
(
self
)
@archiver
=
Command
::
Archiver
.
new
(
self
)
@yacc
=
Command
::
Yacc
.
new
(
self
)
@gperf
=
Command
::
Gperf
.
new
(
self
)
@git
=
Command
::
Git
.
new
(
self
)
@mrbc
=
Command
::
Mrbc
.
new
(
self
)
@bins
=
%w(mruby mrbc mirb)
@gems
,
@libmruby
=
[],
[]
MRuby
.
targets
[
name
.
to_s
]
=
self
instance_eval
(
&
block
)
compilers
.
each
do
|
compiler
|
if
ENV
[
'OS'
]
==
'Windows_NT'
if
respond_to?
(
:enable_gems?
)
&&
enable_gems?
@exts
=
Exts
.
new
(
'.o'
,
'.exe'
,
'.a'
)
compiler
.
defines
-=
%w(DISABLE_GEMS)
else
else
compiler
.
defines
+=
%w(DISABLE_GEMS)
@exts
=
Exts
.
new
(
'.o'
,
''
,
'.a'
)
end
end
compiler
.
define_rules
build_dir
@file_separator
=
'/'
@cc
=
Command
::
Compiler
.
new
(
self
,
%w(.c)
)
@cxx
=
Command
::
Compiler
.
new
(
self
,
%w(.cc .cxx .cpp)
)
@objc
=
Command
::
Compiler
.
new
(
self
,
%w(.m)
)
@asm
=
Command
::
Compiler
.
new
(
self
,
%w(.S .asm)
)
@linker
=
Command
::
Linker
.
new
(
self
)
@archiver
=
Command
::
Archiver
.
new
(
self
)
@yacc
=
Command
::
Yacc
.
new
(
self
)
@gperf
=
Command
::
Gperf
.
new
(
self
)
@git
=
Command
::
Git
.
new
(
self
)
@mrbc
=
Command
::
Mrbc
.
new
(
self
)
@bins
=
%w(mruby mrbc mirb)
@gems
,
@libmruby
=
[],
[]
MRuby
.
targets
[
@name
]
=
self
end
end
MRuby
::
Build
.
current
=
MRuby
.
targets
[
@name
]
MRuby
.
targets
[
@name
].
instance_eval
(
&
block
)
end
end
def
toolchain
(
name
)
def
toolchain
(
name
)
...
@@ -112,6 +106,17 @@ module MRuby
...
@@ -112,6 +106,17 @@ module MRuby
end
end
end
end
def
define_rules
compilers
.
each
do
|
compiler
|
if
respond_to?
(
:enable_gems?
)
&&
enable_gems?
compiler
.
defines
-=
%w(DISABLE_GEMS)
else
compiler
.
defines
+=
%w(DISABLE_GEMS)
end
compiler
.
define_rules
build_dir
end
end
def
filename
(
name
)
def
filename
(
name
)
if
name
.
is_a?
(
Array
)
if
name
.
is_a?
(
Array
)
name
.
flatten
.
map
{
|
n
|
filename
(
n
)
}
name
.
flatten
.
map
{
|
n
|
filename
(
n
)
}
...
...
tasks/mruby_build_commands.rake
View file @
24679c6d
...
@@ -36,14 +36,14 @@ module MRuby
...
@@ -36,14 +36,14 @@ module MRuby
def
initialize
(
build
,
source_exts
=
[])
def
initialize
(
build
,
source_exts
=
[])
super
(
build
)
super
(
build
)
@command
=
ENV
[
'CC'
]
||
'
g
cc'
@command
=
ENV
[
'CC'
]
||
'cc'
@flags
=
[
ENV
[
'CFLAGS'
]
||
[]]
@flags
=
[
ENV
[
'CFLAGS'
]
||
[]]
@source_exts
=
source_exts
@source_exts
=
source_exts
@include_paths
=
[
"
#{
build
.
root
}
/include"
]
@include_paths
=
[
"
#{
build
.
root
}
/include"
]
@defines
=
%w()
@defines
=
%w()
@option_include_path
=
'-I%s'
@option_include_path
=
'-I%s'
@option_define
=
'-D%s'
@option_define
=
'-D%s'
@compile_options
=
"%{flags} -MMD -o %{outfile} -c %{infile}"
@compile_options
=
'%{flags} -o %{outfile} -c %{infile}'
end
end
def
all_flags
(
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
def
all_flags
(
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
...
@@ -111,7 +111,7 @@ module MRuby
...
@@ -111,7 +111,7 @@ module MRuby
def
initialize
(
build
)
def
initialize
(
build
)
super
super
@command
=
ENV
[
'LD'
]
||
'
gcc
'
@command
=
ENV
[
'LD'
]
||
'
ld
'
@flags
=
(
ENV
[
'LDFLAGS'
]
||
[])
@flags
=
(
ENV
[
'LDFLAGS'
]
||
[])
@flags_before_libraries
,
@flags_after_libraries
=
[],
[]
@flags_before_libraries
,
@flags_after_libraries
=
[],
[]
@libraries
=
[]
@libraries
=
[]
...
...
tasks/toolchains/clang.rake
View file @
24679c6d
MRuby
::
Toolchain
.
new
(
:clang
)
do
|
conf
|
MRuby
::
Toolchain
.
new
(
:clang
)
do
|
conf
|
toolchain
:gcc
toolchain
:gcc
[
conf
.
cc
,
conf
.
cxx
,
conf
.
objc
].
each
do
|
cc
|
[
conf
.
cc
,
conf
.
cxx
,
conf
.
objc
,
conf
.
asm
].
each
do
|
cc
|
cc
.
command
=
ENV
[
'CC'
]
||
'clang'
cc
.
command
=
ENV
[
'CC'
]
||
'clang'
end
end
conf
.
linker
.
command
=
ENV
[
'LD'
]
||
'clang'
conf
.
linker
.
command
=
ENV
[
'LD'
]
||
'clang'
...
...
tasks/toolchains/gcc.rake
View file @
24679c6d
MRuby
::
Toolchain
.
new
(
:gcc
)
do
|
conf
|
MRuby
::
Toolchain
.
new
(
:gcc
)
do
|
conf
|
[
conf
.
cc
,
conf
.
cxx
,
conf
.
objc
].
each
do
|
cc
|
[
conf
.
cc
,
conf
.
cxx
,
conf
.
objc
,
conf
.
asm
].
each
do
|
cc
|
cc
.
command
=
ENV
[
'CC'
]
||
'gcc'
cc
.
command
=
ENV
[
'CC'
]
||
'gcc'
cc
.
flags
=
[
ENV
[
'CFLAGS'
]
||
%w(-g -O3 -Wall -Werror-implicit-function-declaration)
]
cc
.
flags
=
[
ENV
[
'CFLAGS'
]
||
%w(-g -O3 -Wall -Werror-implicit-function-declaration)
]
cc
.
include_paths
=
[
"
#{
root
}
/include"
]
cc
.
include_paths
=
[
"
#{
root
}
/include"
]
...
...
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