diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-10 23:08:13 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-10 23:08:13 -0700 |
| commit | 3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5 (patch) | |
| tree | edbdfebe2e9a330c250152929a545a20f6d8ff95 | |
| parent | a0aa753a0b121f193681bc679972f26ba5c322db (diff) | |
| parent | 9cf7d54b5713c9471dffc08c4dcb6396084f12d0 (diff) | |
| download | mruby-3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5.tar.gz mruby-3806b53db5ff4e73df4d4b7600ba0fbdbef6e0d5.zip | |
Merge pull request #1168 from monaka/pr-update-gem-application
Update gem application support.
| -rw-r--r-- | Rakefile | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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 |
