Allow MRUBY_CONFIG to specify target file out of source tree.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-08-14 14:15:29 +09:00
parent 7dc595f98f
commit ef9df5dc7d
2 changed files with 11 additions and 2 deletions
+7 -2
View File
@@ -14,8 +14,13 @@ require "mruby-core-ext"
require "mruby/build"
# load configuration file
MRUBY_TARGET = ENV['MRUBY_TARGET'] || ENV['TARGET'] || "host"
MRUBY_CONFIG = "#{MRUBY_ROOT}/target/#{MRUBY_TARGET}.rb"
if ENV['MRUBY_CONFIG']
MRUBY_CONFIG = ENV['MRUBY_CONFIG']
MRUBY_TARGET = File.basename(MRUBY_CONFIG, ".rb")
else
MRUBY_TARGET = ENV['MRUBY_TARGET'] || ENV['TARGET'] || "host"
MRUBY_CONFIG = "#{MRUBY_ROOT}/target/#{MRUBY_TARGET}.rb"
end
load MRUBY_CONFIG
# load basic rules
+4
View File
@@ -43,6 +43,10 @@ in `target/host.rb`. There are many other targets for example:
`target/host.rb` comes with comments to help writing a new
target description.
If you want to have your target description out of the
source tree, you can specify the path to the description
file in `MRUBY_CONFIG`.
= Build Target Contribution
When you write a new target description, please