Separate rake install related stuff into tasks/install.rake

This commit is contained in:
dearblue
2023-02-12 21:02:27 +09:00
parent bed7a79add
commit c020d8507e
3 changed files with 28 additions and 28 deletions
+1 -28
View File
@@ -31,6 +31,7 @@ load "#{MRUBY_ROOT}/tasks/presym.rake"
load "#{MRUBY_ROOT}/tasks/test.rake"
load "#{MRUBY_ROOT}/tasks/benchmark.rake"
load "#{MRUBY_ROOT}/tasks/doc.rake"
load "#{MRUBY_ROOT}/tasks/install.rake"
##############################
# generic build targets, rules
@@ -67,34 +68,6 @@ task :deep_clean => %w[clean doc:clean] do
puts "Cleaned up mrbgems build folder"
end
PREFIX = ENV['PREFIX'] || ENV['INSTALL_PREFIX'] || '/usr/local'
desc "install compiled products"
task :install => :install_bin do
if host = MRuby.targets['host']
install_D host.libmruby_static, File.join(PREFIX, "lib", File.basename(host.libmruby_static))
# install mruby.h and mrbconf.h
Dir.glob(File.join(MRUBY_ROOT, "include", "*.h")) do |src|
install_D src, File.join(PREFIX, "include", File.basename(src))
end
Dir.glob(File.join(MRUBY_ROOT, "include", "mruby", "*.h")) do |src|
install_D src, File.join(PREFIX, "include", "mruby", File.basename(src))
end
Dir.glob(File.join(File.join(MRUBY_ROOT, "build", "host", "include", "mruby", "presym", "*.h"))) do |src|
install_D src, File.join(PREFIX, "include", "mruby", "presym", File.basename(src))
end
end
end
desc "install compiled executable (on host)"
task :install_bin => :all do
if host = MRuby.targets['host']
Dir.glob(File.join(MRUBY_ROOT, "bin", "*")) do |src|
install_D src, File.join(PREFIX, "bin", File.basename(src))
end
end
end
desc "run all pre-commit hooks against all files"
task :check do
sh "pre-commit run --all-files"
+2
View File
@@ -7,6 +7,8 @@ module MRuby
autoload :Lockfile, "mruby/lockfile"
autoload :Presym, "mruby/presym"
INSTALL_PREFIX = ENV['PREFIX'] || ENV['INSTALL_PREFIX'] || '/usr/local'
class << self
def targets
@targets ||= {}
+25
View File
@@ -0,0 +1,25 @@
desc "install compiled products"
task :install => :install_bin do
if host = MRuby.targets['host']
install_D host.libmruby_static, File.join(MRuby::INSTALL_PREFIX, "lib", File.basename(host.libmruby_static))
# install mruby.h and mrbconf.h
Dir.glob(File.join(MRUBY_ROOT, "include", "*.h")) do |src|
install_D src, File.join(MRuby::INSTALL_PREFIX, "include", File.basename(src))
end
Dir.glob(File.join(MRUBY_ROOT, "include", "mruby", "*.h")) do |src|
install_D src, File.join(MRuby::INSTALL_PREFIX, "include", "mruby", File.basename(src))
end
Dir.glob(File.join(File.join(MRUBY_ROOT, "build", "host", "include", "mruby", "presym", "*.h"))) do |src|
install_D src, File.join(MRuby::INSTALL_PREFIX, "include", "mruby", "presym", File.basename(src))
end
end
end
desc "install compiled executable (on host)"
task :install_bin => :all do
if host = MRuby.targets['host']
Dir.glob(File.join(MRUBY_ROOT, "bin", "*")) do |src|
install_D src, File.join(MRuby::INSTALL_PREFIX, "bin", File.basename(src))
end
end
end