From a55ffc78e8f2a0847cfb05b1e40dda4078500d10 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Tue, 18 Sep 2012 13:14:54 +0900 Subject: Generic sh-elf target support. --- cmake/Toolchain-OSX-GenericShElf.cmake.sample | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cmake/Toolchain-OSX-GenericShElf.cmake.sample diff --git a/cmake/Toolchain-OSX-GenericShElf.cmake.sample b/cmake/Toolchain-OSX-GenericShElf.cmake.sample new file mode 100644 index 000000000..1f847830a --- /dev/null +++ b/cmake/Toolchain-OSX-GenericShElf.cmake.sample @@ -0,0 +1,37 @@ +# +# 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) -- cgit v1.2.3 From fcf38cc86bf9e7e41212888830fefa0d5f1fbe38 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Tue, 18 Sep 2012 21:36:00 +0900 Subject: Add a contribution information file --- CONTRIBUTING.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++ doc/coding_conventions.md | 48 --------------------------------- 2 files changed, 67 insertions(+), 48 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 doc/coding_conventions.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..fdf47c29d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# How to contribute + +mruby is a young open-source project. + +We are looking forward to each pull request. + +## Pull Request + +To make it easy to review und understand your change please keep the following +things in mind for your pull request: + +* Make you change 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 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 + +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) + +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 +(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf). + +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 + +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 + + /* 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: + + int + main(void) + { + ... + } + +### 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) + +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). diff --git a/doc/coding_conventions.md b/doc/coding_conventions.md deleted file mode 100644 index aa47fe980..000000000 --- a/doc/coding_conventions.md +++ /dev/null @@ -1,48 +0,0 @@ -# Coding conventions - -How to style your C and Ruby code which you want to submit. - -## 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) - -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 -(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf). - -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 - -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 - - /* 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: - - int - main(void) - { - ... - } - -## 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) - -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). -- cgit v1.2.3 From 2493915a72fcc57148a17109f9be8525fc887790 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Tue, 18 Sep 2012 21:38:15 +0900 Subject: Emphasis commands --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fdf47c29d..199def696 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,8 +9,8 @@ We are looking forward to each pull request. To make it easy to review und understand your change please keep the following things in mind for your pull request: -* Make you change on the latest possible state of +mruby/master+ -* Test your changes before creating a pull request (+make test+) +* Make you change 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 change -- cgit v1.2.3 From 5e16c2309f95d5b9becec799e23d244390a7d230 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Tue, 18 Sep 2012 22:20:05 +0900 Subject: re-formulate some sentences --- CONTRIBUTING.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 199def696..08995978f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,19 +1,17 @@ # How to contribute -mruby is a young open-source project. +mruby is an open-source project which is looking forward to each contribution. -We are looking forward to each pull request. +## Your Pull Request -## Pull Request +To make it easy to review and understand your change please keep the following +things in mind before submitting your pull request: -To make it easy to review und understand your change please keep the following -things in mind for your pull request: - -* Make you change on the latest possible state of **mruby/master** +* 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 change +* 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) -- cgit v1.2.3