From ef9df5dc7d32b79e6b4e0d6924eeae2cc614dfce Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 14 Aug 2020 14:15:29 +0900 Subject: Allow `MRUBY_CONFIG` to specify target file out of source tree. --- Rakefile | 9 +++++++-- doc/mruby3.md | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 2198b27fd..52b4c75c1 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/doc/mruby3.md b/doc/mruby3.md index 75bd5870e..29da25cbc 100644 --- a/doc/mruby3.md +++ b/doc/mruby3.md @@ -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 -- cgit v1.2.3