mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1168 from monaka/pr-update-gem-application
Update gem application support.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user