diff options
| author | Yuichiro MASUI <[email protected]> | 2013-02-23 16:36:57 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2013-02-23 19:03:59 +0900 |
| commit | 0970ca957226d52af52e1f261fbb7ee8b3086cce (patch) | |
| tree | 44d19fe10c6650d9010d25ab840ce6e7e2f860fb /tools | |
| parent | 58b9e7672474160df90ba11c915eeac093fe12d2 (diff) | |
| download | mruby-0970ca957226d52af52e1f261fbb7ee8b3086cce.tar.gz mruby-0970ca957226d52af52e1f261fbb7ee8b3086cce.zip | |
Support to build on pwd != mruby source root
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/mirb/mirb.rake | 6 | ||||
| -rw-r--r-- | tools/mrbc/mrbc.rake | 6 | ||||
| -rw-r--r-- | tools/mruby/mruby.rake | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/tools/mirb/mirb.rake b/tools/mirb/mirb.rake index 46e69136e..f258a9df9 100644 --- a/tools/mirb/mirb.rake +++ b/tools/mirb/mirb.rake @@ -1,9 +1,11 @@ MRuby.each_target do - dir = File.dirname(__FILE__).relative_path_from(root) + 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("#{dir}/*.c").map { |f| objfile(f.pathmap("#{build_dir}/%X")) }.flatten + 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 } diff --git a/tools/mrbc/mrbc.rake b/tools/mrbc/mrbc.rake index 0121b7f81..1a0309a0d 100644 --- a/tools/mrbc/mrbc.rake +++ b/tools/mrbc/mrbc.rake @@ -1,9 +1,11 @@ MRuby.each_target do - dir = File.dirname(__FILE__).relative_path_from(root) + 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 == 'mrbc' } exec = exefile("#{build_dir}/bin/mrbc") - objs = Dir.glob("#{dir}/*.c").map { |f| objfile(f.pathmap("#{build_dir}/%X")) }.flatten + objs = Dir.glob("#{current_dir}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/%n")) }.flatten file exec => objs + [libfile("#{build_dir}/lib/libmruby_core")] do |t| linker.run t.name, t.prerequisites diff --git a/tools/mruby/mruby.rake b/tools/mruby/mruby.rake index fccebff63..dc3cbe2a2 100644 --- a/tools/mruby/mruby.rake +++ b/tools/mruby/mruby.rake @@ -1,9 +1,11 @@ MRuby.each_target do - dir = File.dirname(__FILE__).relative_path_from(root) + 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("#{dir}/*.c").map { |f| objfile(f.pathmap("#{build_dir}/%X")) }.flatten + 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 } |
