From da994e5a7c17b81919b8cb7cf9e8a08c52e7b996 Mon Sep 17 00:00:00 2001 From: Evgeny Gavrin Date: Sat, 13 Jun 2015 21:34:31 +0300 Subject: [PATCH] Clean Up How-To page --- 02.how-to.md | 107 ++++++++++++++++++++++++++++++++---------------- 05.dev-guide.md | 87 +-------------------------------------- 2 files changed, 72 insertions(+), 122 deletions(-) diff --git a/02.how-to.md b/02.how-to.md index 0f7c857c5..fc3263e6f 100644 --- a/02.how-to.md +++ b/02.how-to.md @@ -4,53 +4,88 @@ title: How To permalink: /how-to/ --- -This is very simple way of compiling JerryScript. (Please add more so to guide how to build.) - -## Get the source - -You may know this. -``` +# How to Get the Sources +This step should be simple: +{% highlight bash %} git clone https://github.com/Samsung/jerryscript.git cd jerryscript -``` +{% endhighlight %} -## Building +# How to Setup Recommended Prerequisites -It's based on Ubuntu Linux 14.04 LTS. You may need to read https://github.com/Samsung/jerryscript/wiki/Prerequisites before starting. +Currently, we are using Ubuntu Linux 14.04+ as our development environment, so this tutorial was written based on this assumption. Additionaly, it'd be useful to read [Prerequisites]({{ site.baseurl }}/wiki/Prerequisites) wiki page, also. -``` +There are dependencies, that should be installed manually. The following list is required for building: + +- `gcc` or `g++` higher than `4.8.2` + - native + - arm-none-eabi +- `cmake` higher than `2.8.12.2` +- `make` higher than `3.81` +- `bash` higher than `4.3.11` + +These tools are required for development: + +- `cppcheck` requires `libpcre` +- `vera++` requires `tcl`, `tk` and `boost` + +{% highlight bash %} +sudo apt-get install gcc g++ +sudo apt-get install gcc-arm-none-eabi g++-arm-none-eabi +sudo apt-get install cmake +sudo apt-get install libpcre3 libpcre3-dev +sudo apt-get install tcl8.6 tcl8.6-dev tk8.6-dev libboost-all-dev +{% endhighlight %} + +To make our scripts run correctly, several shell utilities should be available the system: + +- `find` +- `bc` +- `awk` +- `sed` +- `sha256sum` +- `wget` + +# How to Build + +After setting up prerequisites, let's built the engine: +{% highlight bash %} make -``` -For the first time of the make, it'll prepare prerequisites with next message. It may take some time so go grab some coffee. -``` +{% endhighlight %} + +Upon first build, `make` would try to setup prerequisites, required for further development and pre-commit testing: +- stm32f3 and stm32f4 libraries +- nuttx's headers +- cppcheck 1.66 +- vera++ 1.2.1 + +It may take time, so go grab some coffee: +{% highlight bash %} Setting up prerequisites... (log file: ./build/prerequisites/prerequisites.log) -``` +{% endhighlight %} -After prerequisites are prepared, make will build all supporting platforms and mods. It may also take a while. - -If only debug version for linux for development, just do as; -``` +## How to Build Debug Version +To build debug version for Linux: +{% highlight bash %} make debug.linux -``` +{% endhighlight %} -without LTO(Link Time Optimization) and debug for linux -``` -LTO=ff make debug.linux -``` +To build debug version for Linux without LTO (Link Time Optimization): +{% highlight bash %} +LTO=off make debug.linux +{% endhighlight %} -if something goes wrong, it'll show -``` -Build failed. See ./build/bin/unittests/make.log for details. -``` - -## Testing -``` +# How to Run Unittests +{% highlight bash %} make unittests -``` -It should have no errors if it is ok. +{% endhighlight %} -## Check before committing -``` +# How to Check the Patch +{% highlight bash %} make precommit -j -``` -This will check any problems in your modifications. may take some time depending on your machine. This is necessary before pull requests but can omit for local commits. +{% endhighlight %} + +Sometimes pre-commit testing fails, in that case you'll see message like that: +{% highlight bash %} +Build failed. See ./build/bin/unittests/make.log for details. +{% endhighlight %} diff --git a/05.dev-guide.md b/05.dev-guide.md index a5a392a58..032395ff2 100644 --- a/05.dev-guide.md +++ b/05.dev-guide.md @@ -4,89 +4,4 @@ title: Development permalink: /dev-guide/ --- -### Prerequisites setup - -Upon first build, `make` would try to setup prerequisites, required for further development and precommit testing: -- stm32f3 and stm32f4 libraries -- nuttx's headers -- cppcheck 1.66 -- vera++ 1.2.1 - -However, there are some dependencies, that should be installed manually: -- gcc / g++ (recommended \>= 4.8.2) - - native - - arm-none-eabi - - ``` - sudo apt-get install gcc-arm-none-eabi - ``` - - -- cmake \>= 2.8.12.2 -- make \>= 3.81 -- bash \>= 4.3.11 -- cppcheck requires `libpcre` - - ``` - sudo apt-get install cmake libpcre3 libpcre3-dev - ``` - -- vera++ requires `tcl`, `tk` and `boost` - - ``` - sudo apt-get install tcl8.6 tcl8.6-dev tk8.6-dev - sudo apt-get install libboost-all-dev - ``` - -Several shell utilities: -- find -- bc -- awk -- sed -- sha256sum -- wget - - -### Proposals, Get Answers and Report a Bug via Github Issues - -If you have a question about JerryScript code, have trouble any documentation, would like to suggest new feature, or find a bug, [review the current JerryScript issues](https://github.com/Samsung/jerryscript/issues) in GitHub, and if necessary, [create a new issue](https://github.com/Samsung/jerryscript/issues/new). - -**There are several labels on the Issue. Please choose proper labels on the purpose.** -* **bug** -* **enhancement** : feature enhancement proposal -* **feature request** : new feature proposal -* **question** : any questions on the project - -and so on. - -*** - -### Patch Submission Process - -If your patchset include a new feature, please discuss with community members in advance via Github Issues. -When you're confident with your patchset, please submit your patch by following steps. - -#### 1. Scope the patch - -Smaller patches are generally easier to understand and test, so please submit changes in the smallest increments possible. - -#### 2. Sign your work with the [JerryScript DCO](https://github.com/Samsung/jerryscript/wiki/JerryScript-Developer's-Certificate-of-Origin-1.0) - -The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an Open Source patch. The sign-off is required for a patch to be accepted. - -#### 3. Open [a Github pull request](https://github.com/Samsung/jerryscript/pulls/new) - -#### 4. Code review - -Code review can be performed by all the members of the Project (not just Maintainers and Committers). Members can review code changes and share their opinion by comments with the following principles: - -* Discuss code; never discuss the code's author. -* Respect and acknowledge contributions, suggestions, and comments. -* Listen and be open to all different opinions. -* Help each other. - -Changes are submitted via pull requests and only the Maintainers and Committers should approve or reject the pull request. - -#### 5. Maintain the code - -When the patches are accepted through proper review process and integrated into the master branch, please keep in mind that you have a responsibility to maintain the code throughout its lifecycle. +TBD