Commit cf7fb881 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge branch 'monaka-pr-move-mirb-mruby-to-mrbgems'

parents 9f3aca8f 65fccc28
......@@ -25,8 +25,6 @@ load "#{MRUBY_ROOT}/tools/mrbc/mrbc.rake"
load "#{MRUBY_ROOT}/tasks/mrbgems.rake"
load "#{MRUBY_ROOT}/tasks/libmruby.rake"
load "#{MRUBY_ROOT}/tools/mruby/mruby.rake"
load "#{MRUBY_ROOT}/tools/mirb/mirb.rake"
load "#{MRUBY_ROOT}/tasks/mrbgems_test.rake"
load "#{MRUBY_ROOT}/test/mrbtest.rake"
......
......@@ -43,13 +43,20 @@ MRuby::Build.new do |conf|
# Use Random class
conf.gem "#{root}/mrbgems/mruby-random"
# No use eval method
# conf.gem "#{root}/mrbgems/mruby-eval"
# Generate binaries
# conf.bins = %w(mrbc mruby mirb)
# conf.bins = %w(mrbc)
# Generate mirb command
conf.gem "#{root}/mrbgems/mruby-bin-mirb"
# Generate mruby command
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
# C compiler settings
# conf.cc do |cc|
......
MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
spec.license = 'MIT'
spec.authors = 'mruby developers'
spec.bins = %w(mirb)
end
MRuby::Gem::Specification.new('mruby-bin-mruby') do |spec|
spec.license = 'MIT'
spec.authors = 'mruby developers'
spec.bins = %w(mruby)
end
......@@ -74,7 +74,7 @@ module MRuby
@git = Command::Git.new(self)
@mrbc = Command::Mrbc.new(self)
@bins = %w(mruby mrbc mirb)
@bins = %w(mrbc)
@gems, @libmruby = [], []
@build_mrbtest_lib_only = false
......
MRuby.each_target do
current_dir = File.dirname(__FILE__).relative_path_from(Dir.pwd)
relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
current_build_dir = "#{build_dir}/#{relative_from_root}"
if bins.find { |s| s.to_s == 'mirb' }
exec = exefile("#{build_dir}/bin/mirb")
objs = Dir.glob("#{current_dir}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/%n")) }
file exec => objs + [libfile("#{build_dir}/lib/libmruby")] do |t|
gem_flags = gems.map { |g| g.linker.flags }
gem_flags_before_libraries = gems.map { |g| g.linker.flags_before_libraries }
gem_flags_after_libraries = gems.map { |g| g.linker.flags_after_libraries }
gem_libraries = gems.map { |g| g.linker.libraries }
gem_library_paths = gems.map { |g| g.linker.library_paths }
linker.run t.name, t.prerequisites, gem_libraries, gem_library_paths, gem_flags, gem_flags_before_libraries
end
end
end
MRuby.each_target do
current_dir = File.dirname(__FILE__).relative_path_from(Dir.pwd)
relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
current_build_dir = "#{build_dir}/#{relative_from_root}"
if bins.find { |s| s.to_s == 'mruby' }
exec = exefile("#{build_dir}/bin/mruby")
objs = Dir.glob("#{current_dir}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/%n")) }.flatten
file exec => objs + [libfile("#{build_dir}/lib/libmruby")] do |t|
gem_flags = gems.map { |g| g.linker.flags }
gem_flags_before_libraries = gems.map { |g| g.linker.flags_before_libraries }
gem_flags_after_libraries = gems.map { |g| g.linker.flags_after_libraries }
gem_libraries = gems.map { |g| g.linker.libraries }
gem_library_paths = gems.map { |g| g.linker.library_paths }
linker.run t.name, t.prerequisites, gem_libraries, gem_library_paths, gem_flags, gem_flags_before_libraries
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment