Revert MRUBY_TARGET mechanism; ref #5096

* In explanation of mruby, the expression `build_config.rb` is frequently
  used including official documents, so I think that it will not make sense
  if the file is no longer used.
* The `MRUBY_TARGET` mechanism seems to have little improvement, so I don't
  think it should be changed to avoid unnecessary confusion.
* `MRUBY_TARGET` and `MRuby.targets` represent somewhat different things,
  so using the same term "target" is a bit confusing.

The mechanism that can be written short when using a file under
`build_config` (renamed from `target`) directory remains
(`build_config/${MRUBY_CONFIG}.rb` is used if the path specified
in `MRUBY_CONFIG` doesn't exist).
This commit is contained in:
KOBAYASHI Shuji
2020-10-19 15:03:22 +09:00
parent 27492e53a0
commit 81c2108819
31 changed files with 50 additions and 81 deletions
+14 -25
View File
@@ -24,40 +24,29 @@ Optional:
## Build
To compile `mruby`, just call `rake` inside of the mruby source
root. To generate and execute the test tools call `rake test`. To
clean all build files call `rake clean`. To see full command line on
build, call `rake -v`.
If you want to compile for the specific configuration, specify
`MRUBY_TARGET` or `TARGET` environment variable, e.g
```sh
rake TAGRET=host
```
The default target is `host`. The compilation target desciption files
(with `.rb` suffix) are contained in the `target` directory.
A build description file contains the build configuration of mruby and
looks like the following for example:
Inside of the root directory of the mruby source a file exists
called *build_config.rb*. This file contains the build configuration
of mruby and looks like this for example:
```ruby
MRuby::Build.new do |conf|
toolchain :gcc
end
```
All tools necessary to compile mruby can be set or modified here. In
case you want to try different configuration, you can create a new
configuration file under `target` and specify the configuration using
the `MRUBY_TARGET` environment variable.
All tools necessary to compile mruby can be set or modified here. In case
you want to maintain an additional *build_config.rb* you can define a
customized path using the *$MRUBY_CONFIG* environment variable. If the
path doesn't exist, *build_config/${MRUBY_CONFIG}.rb* is used.
To compile just call `rake` inside of the mruby source root. To
generate and execute the test tools call `rake test`. To clean
all build files call `rake clean`. To see full command line on
build, call `rake -v`.
## Build Configuration
To create a new configuration, copy the existing configuration in the
`target` directory, and modify it. We wish you submit a pull-request,
once you created a new configuration for a new platform.
We wish you submit a pull-request to *build_config/**PLATFORM**.rb*, once you
created a new configuration for a new platform.
Inside of the configuration file, the following options can be
configured based on your environment.
+8 -24
View File
@@ -3,45 +3,29 @@ User visible changes in `mruby3`
# Build System
You can specify `TARGET` option to `rake` via a command line
option, or via an environment variable, e.g.
`rake TARGET=host all`
or
`TARGET=host rake all`
It's much easier to switch multiple targets than the
previous `build_config.rb` system.
## `presym` target
The first compilation of `mruby` may require generation of a
static symbol table named `build/presym`. You can generate
the table by `rake gensym`.
## `target` directory
## `build_config` directory
Build target specification files are loaded from `target`
directory. The default `TARGET` is `host` which is described
in `target/host.rb`. There are many other targets for example:
Typical build configuration files are located in `build_config`
directory. For examples:
* `host-gprof`: compiles with `gprof` for performance tuning
* `host-m32`: compiles in gcc 32bit mode on 64bit platforms
* `boxing`: compiles all three boxing options
* `clang-asan`: compiles with `clang`'s Address Sanitizer
`target/host.rb` comes with comments to help writing a new
target description.
`build_config/${MRUBY_CONFIG}.rb` is used if the path specified
in `MRUBY_CONFIG` doesn't exist, so you can specify it as
`rake MRUBY_CONFIG=boxing`.
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 Configuration Contribution
# Build Target Contribution
When you write a new target description, please
When you write a new build configuration description, please
contribute. We welcome your contribution as a GitHub
pull-request.