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
15cf8fde
Commit
15cf8fde
authored
Sep 20, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mruby/mruby
parents
44b28a83
1afda93c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
8 deletions
+62
-8
CONTRIBUTING.md
CONTRIBUTING.md
+25
-8
cmake/Toolchain-OSX-GenericShElf.cmake.sample
cmake/Toolchain-OSX-GenericShElf.cmake.sample
+37
-0
No files found.
doc/coding_conventions
.md
→
CONTRIBUTING
.md
View file @
15cf8fde
# Coding conventions
# How to contribute
mruby is an open-source project which is looking forward to each contribution.
## Your Pull Request
To make it easy to review and understand your change please keep the following
things in mind before submitting your pull request:
*
Work on the latest possible state of
**mruby/master**
*
Test your changes before creating a pull request (
**make test**
)
*
If possible write a test case which confirms your change
*
Don't mix several features or bug-fixes in one pull request
*
Create a branch which is dedicated to your change
*
Create a meaningful commit message
*
Explain your change (i.e. with a link to the issue you are fixing)
## Coding conventions
How to style your C and Ruby code which you want to submit.
## C code
##
#
C code
The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is
written in the C programming language. Please note the following hints for your
C code:
### Comply with C99 (ISO/IEC 9899:1999)
###
#
Comply with C99 (ISO/IEC 9899:1999)
mruby should be highly portable to other systems and compilers. For that it is
recommended to keep your code as close as possible to the C99 standard
...
...
@@ -17,19 +34,19 @@ recommended to keep your code as close as possible to the C99 standard
Although we target C99, VC is also an important target for mruby, so that we
avoid local variable declaration in the middle.
### Reduce library dependencies to a minimum
###
#
Reduce library dependencies to a minimum
The dependencies to libraries should be put to an absolute minimum. This
increases the portability but makes it also easier to cut away parts of mruby
on-demand.
### Don't use C++ style comments
###
#
Don't use C++ style comments
/* This is the prefered comment style */
Use C++ style comments only for temporary comment e.g. commenting out some code lines.
### Insert a break after the method return value:
###
#
Insert a break after the method return value:
int
main(void)
...
...
@@ -37,12 +54,12 @@ Use C++ style comments only for temporary comment e.g. commenting out some code
...
}
## Ruby code
##
#
Ruby code
Parts of the standard library of mruby is written in the Ruby programming language
itself. Please note the following hints for your Ruby code:
### Comply with the Ruby standard (ISO/IEC 30170:2012)
###
#
Comply with the Ruby standard (ISO/IEC 30170:2012)
mruby is currently targeting to execute Ruby code which complies to ISO/IEC
30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).
cmake/Toolchain-OSX-GenericShElf.cmake.sample
0 → 100644
View file @
15cf8fde
#
# Typical usage:
# 0) install cmake version 2.8-9 or higher.
# 1) install a PizzaFactory cross compiler
# a) darwin toolchain targeting sh-elf: http://sourceforge.jp/projects/pf3gnuchains/downloads/50061/sh-pizzafactory-elf.pkg/
# b) install pkg.
# c) export PATH=$PATH:/pizza/bin
# 2) cp cmake/Toolchain-OSX-GenericShElf.cmake.sample ~/Toolchain-OSX-GenericShElf.cmake
# 3) tweak toolchain values as needed
# 4) cd build
# 5) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-OSX-GenericShElf.cmake ..
# 6) Run mirb on gdb
# a) sh-pizzafactory-elf-gdb tools/mirb/mirb
# b) target sim
# c) load
# d) run
# name of the target OS on which the built artifacts will run
# and the toolchain prefix
set(CMAKE_SYSTEM_NAME Generic)
set(TOOLCHAIN_PREFIX sh-pizzafactory-elf)
# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
# target environment(s) on the build host system
# set 1st to dir with the cross compiler's C/C++ headers/libs
# set 2nd to dir containing personal cross development headers/libs
set(CMAKE_FIND_ROOT_PATH /pizza/${TOOLCHAIN_PREFIX})
# modify default behavior of FIND_XXX() commands to
# search for headers/libs in the target environment and
# search for programs in the build host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
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