Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
76eafa46
Unverified
Commit
76eafa46
authored
Oct 29, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Oct 29, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5098 from shuujii/revert-MRUBY_TARGET-mechanism
Revert `MRUBY_TARGET` mechanism; ref #5096
parents
78d185ef
81c21088
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
50 additions
and
81 deletions
+50
-81
.github/workflows/build.yml
.github/workflows/build.yml
+7
-7
.travis.yml
.travis.yml
+1
-1
README.md
README.md
+1
-13
Rakefile
Rakefile
+1
-8
appveyor.yml
appveyor.yml
+1
-1
build_config.rb
build_config.rb
+0
-0
build_config/ArduinoDue.rb
build_config/ArduinoDue.rb
+0
-0
build_config/IntelEdison.rb
build_config/IntelEdison.rb
+0
-0
build_config/IntelGalileo.rb
build_config/IntelGalileo.rb
+0
-0
build_config/RX630.rb
build_config/RX630.rb
+0
-0
build_config/android_arm64-v8a.rb
build_config/android_arm64-v8a.rb
+0
-0
build_config/android_armeabi.rb
build_config/android_armeabi.rb
+0
-0
build_config/android_armeabi_v7a_neon_hard.rb
build_config/android_armeabi_v7a_neon_hard.rb
+0
-0
build_config/appveyor.rb
build_config/appveyor.rb
+0
-0
build_config/bench.rb
build_config/bench.rb
+0
-0
build_config/boxing.rb
build_config/boxing.rb
+0
-0
build_config/chipKITMax32.rb
build_config/chipKITMax32.rb
+0
-0
build_config/clang-asan.rb
build_config/clang-asan.rb
+0
-0
build_config/cross-32bit.rb
build_config/cross-32bit.rb
+0
-0
build_config/dreamcast_shelf.rb
build_config/dreamcast_shelf.rb
+0
-0
build_config/host-cxx.rb
build_config/host-cxx.rb
+0
-0
build_config/host-debug.rb
build_config/host-debug.rb
+0
-0
build_config/host-gprof.rb
build_config/host-gprof.rb
+0
-0
build_config/host-m32.rb
build_config/host-m32.rb
+0
-0
build_config/host-shared.rb
build_config/host-shared.rb
+0
-0
build_config/travis.rb
build_config/travis.rb
+0
-0
doc/guides/compile.md
doc/guides/compile.md
+14
-25
doc/mruby3.md
doc/mruby3.md
+8
-24
lib/mruby/build.rb
lib/mruby/build.rb
+11
-0
lib/mruby/lockfile.rb
lib/mruby/lockfile.rb
+1
-1
tasks/benchmark.rake
tasks/benchmark.rake
+5
-1
No files found.
.github/workflows/build.yml
View file @
76eafa46
...
...
@@ -6,7 +6,7 @@ jobs:
Ubuntu-1604
:
runs-on
:
ubuntu-16.04
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
steps
:
-
uses
:
actions/checkout@v1
-
name
:
apt
...
...
@@ -17,7 +17,7 @@ jobs:
Ubuntu-1804-gcc
:
runs-on
:
ubuntu-18.04
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
CC
:
gcc
CXX
:
g++
steps
:
...
...
@@ -30,7 +30,7 @@ jobs:
Ubuntu-1804-clang
:
runs-on
:
ubuntu-18.04
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
CC
:
clang
CXX
:
clang++
steps
:
...
...
@@ -43,7 +43,7 @@ jobs:
macOS
:
runs-on
:
macos-latest
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
steps
:
-
uses
:
actions/checkout@v1
-
name
:
brew
...
...
@@ -54,7 +54,7 @@ jobs:
Windows-MinGW
:
runs-on
:
windows-latest
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
CFLAGS
:
-g -O1 -Wall -Wundef
steps
:
-
uses
:
actions/checkout@v1
...
...
@@ -66,7 +66,7 @@ jobs:
Windows-Cygwin
:
runs-on
:
windows-latest
env
:
MRUBY_
TARGET
:
travis
MRUBY_
CONFIG
:
travis
steps
:
-
uses
:
actions/checkout@v1
-
uses
:
actions/cache@v1
...
...
@@ -91,7 +91,7 @@ jobs:
Windows-VC
:
runs-on
:
windows-latest
env
:
MRUBY_
TARGET
:
appveyor
MRUBY_
CONFIG
:
appveyor
# TODO(take-cheeze): Re-enable /O2
CFLAGS
:
"
/c
/nologo
/W3
/we4013
/Zi
/MD
/D_CRT_SECURE_NO_WARNINGS"
CXXFLAGS
:
"
/c
/nologo
/W3
/Zi
/MD
/EHs
/D_CRT_SECURE_NO_WARNINGS"
...
...
.travis.yml
View file @
76eafa46
...
...
@@ -8,7 +8,7 @@ jobs:
-
export PATH="/usr/local/opt/bison/bin:$PATH"
env
:
-
MRUBY_
TARGET
=travis
-
MRUBY_
CONFIG
=travis
script
:
-
rake gensym && rake -m && rake test
README.md
View file @
76eafa46
...
...
@@ -38,22 +38,10 @@ The URL of the mruby home-page is: https://mruby.org.
We don't have a mailing list, but you can use
[
GitHub issues
](
https://github.com/mruby/mruby/issues
)
.
## How to compile and install (mruby and gems)
## How to compile
, test,
and install (mruby and gems)
See the
[
compile.md
](
https://github.com/mruby/mruby/blob/master/doc/guides/compile.md
)
file.
## How to Build
To build mruby, execute the following from the project's root directory.
$ rake TARGET=
<target>
test
The default
`TARGET`
is
`host`
.
`TARGET`
will be loaded from
`target`
directory.
Note:
`bison`
bundled with MacOS is too old to compile
`mruby`
.
Try
`brew install bison`
and follow the instuction shown to update
the
`$PATH`
to compile
`mruby`
.
## Building documentation
There are two sets of documentation in mruby: the mruby API (generated by yard) and C API (Doxygen)
...
...
Rakefile
View file @
76eafa46
...
...
@@ -14,14 +14,7 @@ require "mruby-core-ext"
require
"mruby/build"
# load configuration file
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
MRUBY_CONFIG
=
MRuby
::
Build
.
load_config
# load basic rules
MRuby
.
each_target
do
|
build
|
...
...
appveyor.yml
View file @
76eafa46
...
...
@@ -40,7 +40,7 @@ init:
build_script
:
-
set MRUBY_
TARGET
=appveyor
-
set MRUBY_
CONFIG
=appveyor
-
rake gensym
-
rake -m all
-
rake -E $stdout.sync=true test
target/host
.rb
→
build_config
.rb
View file @
76eafa46
File moved
target
/ArduinoDue.rb
→
build_config
/ArduinoDue.rb
View file @
76eafa46
File moved
target
/IntelEdison.rb
→
build_config
/IntelEdison.rb
View file @
76eafa46
File moved
target
/IntelGalileo.rb
→
build_config
/IntelGalileo.rb
View file @
76eafa46
File moved
target
/RX630.rb
→
build_config
/RX630.rb
View file @
76eafa46
File moved
target
/android_arm64-v8a.rb
→
build_config
/android_arm64-v8a.rb
View file @
76eafa46
File moved
target
/android_armeabi.rb
→
build_config
/android_armeabi.rb
View file @
76eafa46
File moved
target
/android_armeabi_v7a_neon_hard.rb
→
build_config
/android_armeabi_v7a_neon_hard.rb
View file @
76eafa46
File moved
target
/appveyor.rb
→
build_config
/appveyor.rb
View file @
76eafa46
File moved
target
/bench.rb
→
build_config
/bench.rb
View file @
76eafa46
File moved
target
/boxing.rb
→
build_config
/boxing.rb
View file @
76eafa46
File moved
target
/chipKITMax32.rb
→
build_config
/chipKITMax32.rb
View file @
76eafa46
File moved
target
/clang-asan.rb
→
build_config
/clang-asan.rb
View file @
76eafa46
File moved
target
/cross-32bit.rb
→
build_config
/cross-32bit.rb
View file @
76eafa46
File moved
target
/dreamcast_shelf.rb
→
build_config
/dreamcast_shelf.rb
View file @
76eafa46
File moved
target
/host-cxx.rb
→
build_config
/host-cxx.rb
View file @
76eafa46
File moved
target
/host-debug.rb
→
build_config
/host-debug.rb
View file @
76eafa46
File moved
target
/host-gprof.rb
→
build_config
/host-gprof.rb
View file @
76eafa46
File moved
target
/host-m32.rb
→
build_config
/host-m32.rb
View file @
76eafa46
File moved
target
/host-shared.rb
→
build_config
/host-shared.rb
View file @
76eafa46
File moved
target
/travis.rb
→
build_config
/travis.rb
View file @
76eafa46
File moved
doc/guides/compile.md
View file @
76eafa46
...
...
@@ -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.
...
...
doc/mruby3.md
View file @
76eafa46
...
...
@@ -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.
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_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`
.
# Build
Target
Contribution
# Build
Configuration
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.
...
...
lib/mruby/build.rb
View file @
76eafa46
...
...
@@ -39,6 +39,17 @@ module MRuby
class
Build
class
<<
self
attr_accessor
:current
def
load_config
path
=
ENV
[
'MRUBY_CONFIG'
]
if
path
.
nil?
||
path
.
empty?
path
=
"
#{
MRUBY_ROOT
}
/build_config.rb"
elsif
!
File
.
file?
(
path
)
&&
!
Pathname
.
new
(
path
).
absolute?
f
=
"
#{
MRUBY_ROOT
}
/build_config/
#{
path
}
.rb"
path
=
File
.
exist?
(
f
)
?
f
:
File
.
extname
(
path
).
empty?
?
f
:
path
end
load
path
path
end
end
include
Rake
::
DSL
include
LoadGems
...
...
lib/mruby/lockfile.rb
View file @
76eafa46
...
...
@@ -26,7 +26,7 @@ module MRuby
end
def
instance
@instance
||=
new
(
"
#{
MRUBY_
ROOT
}
/build/
#{
MRUBY_TARGET
}
.lock"
)
@instance
||=
new
(
"
#{
MRUBY_
CONFIG
}
.lock"
)
end
end
...
...
tasks/benchmark.rake
View file @
76eafa46
...
...
@@ -9,7 +9,11 @@ def bm_files
end
def
build_config_name
MRUBY_TARGET
if
!
ENV
[
'MRUBY_CONFIG'
].
to_s
.
empty?
File
.
basename
(
ENV
[
'MRUBY_CONFIG'
],
'.rb'
).
gsub
(
'build_config_'
,
''
)
else
"build"
end
end
def
plot_file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment