summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-04-10 23:08:13 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-04-10 23:08:13 -0700
commit3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5 (patch)
treeedbdfebe2e9a330c250152929a545a20f6d8ff95
parenta0aa753a0b121f193681bc679972f26ba5c322db (diff)
parent9cf7d54b5713c9471dffc08c4dcb6396084f12d0 (diff)
downloadmruby-3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5.tar.gz
mruby-3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5.zip
Merge pull request #1168 from monaka/pr-update-gem-application
Update gem application support.
-rw-r--r--Rakefile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Rakefile b/Rakefile
index ab5e6c6e6..a09dde6dd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -47,15 +47,15 @@ depfiles = MRuby.targets['host'].bins.map do |bin|
install_path
end
-MRuby.each_target do
- gems.map do | gem |
+MRuby.each_target do |target|
+ gems.map do |gem|
current_dir = gem.dir.relative_path_from(Dir.pwd)
relative_from_root = gem.dir.relative_path_from(MRUBY_ROOT)
current_build_dir = "#{build_dir}/#{relative_from_root}"
- gem.bins.each do | bin |
+ gem.bins.each do |bin|
exec = exefile("#{build_dir}/bin/#{bin}")
- objs = Dir.glob("#{current_dir}/tool/#{bin}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/tool/#{bin}/%n")) }
+ objs = Dir.glob("#{current_dir}/tools/#{bin}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/tools/#{bin}/%n")) }
file exec => objs + [libfile("#{build_dir}/lib/libmruby")] do |t|
gem_flags = gems.map { |g| g.linker.flags }
@@ -66,7 +66,17 @@ MRuby.each_target do
linker.run t.name, t.prerequisites, gem_libraries, gem_library_paths, gem_flags, gem_flags_before_libraries
end
- depfiles += [ exec ]
+ if target == MRuby.targets['host']
+ install_path = MRuby.targets['host'].exefile("#{MRUBY_ROOT}/bin/#{bin}")
+
+ file install_path => exec do |t|
+ FileUtils.rm_f t.name, { :verbose => $verbose }
+ FileUtils.cp t.prerequisites.first, t.name, { :verbose => $verbose }
+ end
+ depfiles += [ install_path ]
+ else
+ depfiles += [ exec ]
+ end
end
end
end