Re-thinking the build system to bring it more into line with the conventions.

We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2016-07-27 09:48:10 +02:00
parent 778f3c001e
commit ddab1d8152
48 changed files with 1107 additions and 1927 deletions
+37 -33
View File
@@ -4,64 +4,68 @@ Currently, only Ubuntu 14.04+ is officially supported as primary development env
There are several dependencies, that should be installed manually. The following list is required for building:
- `gcc` higher than `4.8.2`
- `gcc` or any C99-compliant compiler
- native
- arm-none-eabi
- `cmake` higher than `2.8.12.2`
- `make` higher than `3.81`
- `bash` higher than `4.3.11`
- `cppcheck` higher than 1.61
- `vera++` higher than 1.2.1
- `cmake` >= `2.8.12.2`
- `bash` >= `4.3.11`
- `cppcheck` >= `1.61`
- `vera++` >= `1.2.1`
- `python` >= `2.7.6`
```bash
sudo apt-get install gcc g++ gcc-arm-none-eabi cmake cppcheck vera++
sudo apt-get install gcc g++ gcc-arm-none-eabi cmake cppcheck vera++ python
```
To make our scripts run correctly, several shell utilities should be available on the system:
- `find`
- `bc`
- `awk`
- `sed`
- `sha256sum`
- `wget`
Upon first build, `make` would try to setup prerequisites, required for further development and pre-commit testing:
- STM32F3 and STM32F4 libraries
```bash
make prerequisites -j
```
It may take time, so go grab some coffee:
```bash
Setting up prerequisites... (log file: ./build/prerequisites/prerequisites.log)
```
### Building Debug Version
To build debug version for Linux:
```bash
make debug.linux -j
python tools/build.py --debug
```
To build debug version for Linux without LTO (Link Time Optimization):
```bash
LTO=OFF make debug.linux -j
python tools/build.py --debug --lto=off
```
Add custom arguments to CMake:
```bash
python tools/build.py --cmake-param CMAKE_PARAM
```
Add toolchain file:
The cmake dir already contains some usable toolchain files.
```bash
python tools/build.py --toolchain TOOLCHAIN
```
Use (jerry|compiler-default|external libc) libc:
```bash
python tools/build.py --libc LIBC
```
The possible arguments are `jerry` , `compiler` , `<path of external lib>`
To get more available buildoptions for Linux:
```bash
python tools/build.py --help
```
### Checking Patch
```bash
make precommit -j
```
If some style guidelines, build or test runs fail during precommit, then this is indicated with a message like this:
```
Build failed. See ./build/bin/unittests/make.log for details.
python tools/run-tests.py --precommit
```