summaryrefslogtreecommitdiffhomepage
path: root/Rakefile
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2013-02-23 16:36:57 +0900
committerYuichiro MASUI <[email protected]>2013-02-23 19:03:59 +0900
commit0970ca957226d52af52e1f261fbb7ee8b3086cce (patch)
tree44d19fe10c6650d9010d25ab840ce6e7e2f860fb /Rakefile
parent58b9e7672474160df90ba11c915eeac093fe12d2 (diff)
downloadmruby-0970ca957226d52af52e1f261fbb7ee8b3086cce.tar.gz
mruby-0970ca957226d52af52e1f261fbb7ee8b3086cce.zip
Support to build on pwd != mruby source root
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile49
1 files changed, 25 insertions, 24 deletions
diff --git a/Rakefile b/Rakefile
index 74e714ca3..1c65321f5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,46 +1,47 @@
# encoding: utf-8
# Build description.
# basic build file for mruby
+MRUBY_ROOT = File.dirname(File.expand_path(__FILE__))
-load 'tasks/ruby_ext.rake'
-load 'tasks/mruby_build.rake'
-load 'tasks/mrbgem_spec.rake'
+# load build systems
+load "#{MRUBY_ROOT}/tasks/ruby_ext.rake"
+load "#{MRUBY_ROOT}/tasks/mruby_build.rake"
+load "#{MRUBY_ROOT}/tasks/mrbgem_spec.rake"
-##############################
-# compile flags
-load 'build_config.rb'
-
-MRUBY_CONFIGS = ['build_config.rb']
-if ENV['MRUBY_CONFIG']
- MRUBY_CONFIGS << ENV['MRUBY_CONFIG']
- load ENV['MRUBY_CONFIG']
+# load configuration file
+MRUBY_CONFIGS = ["#{MRUBY_ROOT}/build_config.rb", ENV['MRUBY_CONFIG']].compact
+MRUBY_CONFIGS.each do |config|
+ load config unless config.empty?
end
+# load basic rules
MRuby.each_target do |build|
build.define_rules
end
-load 'src/mruby_core.rake'
-load 'mrblib/mrblib.rake'
-load 'tools/mrbc/mrbc.rake'
+# load custom rules
+load "#{MRUBY_ROOT}/src/mruby_core.rake"
+load "#{MRUBY_ROOT}/mrblib/mrblib.rake"
+load "#{MRUBY_ROOT}/tools/mrbc/mrbc.rake"
+
+load "#{MRUBY_ROOT}/tasks/mrbgems.rake"
+load "#{MRUBY_ROOT}/tasks/libmruby.rake"
+load "#{MRUBY_ROOT}/tools/mruby/mruby.rake"
+load "#{MRUBY_ROOT}/tools/mirb/mirb.rake"
-load 'tasks/mrbgems.rake'
-load 'tasks/libmruby.rake'
-load 'tools/mruby/mruby.rake'
-load 'tools/mirb/mirb.rake'
+load "#{MRUBY_ROOT}/tasks/mrbgems_test.rake"
+load "#{MRUBY_ROOT}/test/mrbtest.rake"
-load 'tasks/mrbgems_test.rake'
-load 'test/mrbtest.rake'
##############################
# generic build targets, rules
task :default => :all
depfiles = MRuby.targets['host'].bins.map do |bin|
- install_path = MRuby.targets['host'].exefile("bin/#{bin}")
-
- file install_path => MRuby.targets['host'].exefile("build/host/bin/#{bin}") do |t|
- FileUtils.rm t.name, :force => true
+ install_path = MRuby.targets['host'].exefile("#{MRUBY_ROOT}/bin/#{bin}")
+ source_path = MRuby.targets['host'].exefile("#{MRuby.targets['host'].build_dir}/bin/#{bin}")
+
+ file install_path => source_path do |t|
FileUtils.cp t.prerequisites.first, t.name
end