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
117e2ec0
Commit
117e2ec0
authored
Jan 21, 2013
by
Yuichiro MASUI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export build flags to lib/libmruby.flags.mak
parent
0defb590
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
11 deletions
+32
-11
tasks/libmruby.rake
tasks/libmruby.rake
+10
-0
tasks/mrbgem_spec.rake
tasks/mrbgem_spec.rake
+5
-5
tasks/mruby_build_commands.rake
tasks/mruby_build_commands.rake
+17
-6
No files found.
tasks/libmruby.rake
View file @
117e2ec0
MRuby
.
each_target
do
file
libfile
(
"
#{
build_dir
}
/lib/libmruby"
)
=>
libmruby
.
flatten
do
|
t
|
archiver
.
run
t
.
name
,
t
.
prerequisites
open
(
"
#{
build_dir
}
/lib/libmruby.flags.mak"
,
'w'
)
do
|
f
|
f
.
puts
'CFLAGS = "%s"'
%
cc
.
all_flags
.
gsub
(
'"'
,
'\\"'
)
gem_flags
=
gems
.
map
{
|
g
|
g
.
linker
.
flags
}
gem_library_paths
=
gems
.
map
{
|
g
|
g
.
linker
.
library_paths
}
f
.
puts
'LDFLAGS = "%s"'
%
linker
.
all_flags
(
gem_library_paths
,
gem_flags
).
gsub
(
'"'
,
'\\"'
)
gem_libraries
=
gems
.
map
{
|
g
|
g
.
linker
.
libraries
}
f
.
puts
'LIBS = "%s"'
%
linker
.
library_flags
(
gem_libraries
).
gsub
(
'"'
,
'\\"'
)
end
end
end
tasks/mrbgem_spec.rake
View file @
117e2ec0
...
...
@@ -35,15 +35,15 @@ module MRuby
def
setup
MRuby
::
Gem
.
current
=
self
MRuby
::
Build
::
COMMANDS
.
each
do
|
command
|
instance_variable_set
(
"@
#{
command
}
"
,
@build
.
send
(
command
).
clone
)
end
@linker
=
LinkerConfig
.
new
([],
[],
[])
compilers
.
each
do
|
compiler
|
@build
.
compilers
.
each
do
|
compiler
|
compiler
.
defines
-=
%w(DISABLE_GEMS)
compiler
.
include_paths
<<
"
#{
dir
}
/include"
end
MRuby
::
Build
::
COMMANDS
.
each
do
|
command
|
instance_variable_set
(
"@
#{
command
}
"
,
@build
.
send
(
command
).
clone
)
end
@linker
=
LinkerConfig
.
new
([],
[],
[])
@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"
))
}
...
...
tasks/mruby_build_commands.rake
View file @
117e2ec0
...
...
@@ -46,11 +46,15 @@ module MRuby
@compile_options
=
"%{flags} -MMD -o %{outfile} -c %{infile}"
end
def
all_flags
(
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
define_flags
=
[
defines
,
_defineds
].
flatten
.
map
{
|
d
|
option_define
%
d
}
include_path_flags
=
[
include_paths
,
_include_paths
].
flatten
.
map
{
|
f
|
option_include_path
%
filename
(
f
)
}
[
flags
,
define_flags
,
include_path_flags
,
_flags
].
flatten
.
join
(
' '
)
end
def
run
(
outfile
,
infile
,
_defineds
=
[],
_include_paths
=
[],
_flags
=
[])
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
define_flags
=
[
defines
,
_defineds
].
flatten
.
map
{
|
d
|
option_define
%
d
}
include_path_flags
=
[
include_paths
,
_include_paths
,
File
.
dirname
(
infile
)].
flatten
.
map
{
|
f
|
option_include_path
%
filename
(
f
)
}
_run
compile_options
,
{
:flags
=>
[
flags
,
define_flags
,
include_path_flags
,
_flags
].
flatten
.
join
(
' '
),
:infile
=>
filename
(
infile
),
:outfile
=>
filename
(
outfile
)
}
_run
compile_options
,
{
:flags
=>
all_flags
(
_defineds
,
[
_include_paths
,
File
.
dirname
(
infile
)],
_flags
),
:infile
=>
filename
(
infile
),
:outfile
=>
filename
(
outfile
)
}
end
def
define_rules
(
build_dir
,
source_dir
=
''
)
...
...
@@ -108,11 +112,18 @@ module MRuby
@link_options
=
"%{flags} -o %{outfile} %{objs} %{libs}"
end
def
all_flags
(
_library_paths
=
[],
_flags
=
[])
library_path_flags
=
[
library_paths
,
_library_paths
].
flatten
.
map
{
|
f
|
option_library_path
%
filename
(
f
)
}
[
flags
,
library_path_flags
,
_flags
].
flatten
.
join
(
' '
)
end
def
library_flags
(
_libraries
)
[
libraries
,
_libraries
].
flatten
.
reverse
.
map
{
|
d
|
option_library
%
d
}.
join
(
' '
)
end
def
run
(
outfile
,
objfiles
,
_libraries
=
[],
_library_paths
=
[],
_flags
=
[])
FileUtils
.
mkdir_p
File
.
dirname
(
outfile
)
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
)
}
_run
link_options
,
{
:flags
=>
[
flags
,
library_path_flags
,
_flags
].
flatten
.
join
(
' '
),
:outfile
=>
filename
(
outfile
)
,
:objs
=>
filename
(
objfiles
).
join
(
' '
),
:libs
=>
library_flags
.
join
(
' '
)
}
_run
link_options
,
{
:flags
=>
all_flags
(
_library_paths
,
_flags
),
:outfile
=>
filename
(
outfile
)
,
:objs
=>
filename
(
objfiles
).
join
(
' '
),
:libs
=>
library_flags
(
_libraries
)
}
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