Akos Kiss 91e976f8c7 Move jerry-core API implementations and headers into dedicated subdirectories (#1793)
Moved all public API headers under the `jerry-core/include`
directory. This makes installing all the public headers easier.
Also, should we have new public headers in the future, their
installation will be automatic, there will be no need to update the
build files. Moreover, this aligns better with the structure of
other libraries in the project (in those cases, public headers
always reside in `<library>/include`).

Moved all public API implementations under the `jerry-core/api`
directory. This cleans up the root directory of `jerry-core`,
moving all implementation code under "modules", i.e.,
subdirectories. This also makes the future splitting of the big and
monolithic `jerry.c` along features easier, if needed. (Debugger
and snapshot-related functions are already in separate sources.)

Notes:
* `jerryscript.h` is split up to separate header files along
  feature boundaries. These new headers are included by
  `jerryscript.h`, so this is not a breaking change but header
  modularization only.
* `jerry-snapshot.h` is still under `jerry-core/api`, keeping it as
  a non-public header.
* This commit also adapts all targets to the include path change.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-05-04 15:28:24 +02:00
..

JerryScript with mbed OS 5

TL;DR? jump straight to quickstart

Introduction

This directory contains the necessary code to build JerryScript for devices capable of running mbed OS 5. It has been tested with the following boards so far:

Features

Peripheral Drivers

Peripheral Drivers are intended as a 1-to-1 mapping to mbed C++ APIs, with a few differences (due to differences between JavaScript and C++ like lack of operator overloading).

Dependencies

mbed CLI

mbed CLI is used as the build tool for mbed OS 5. You can find out how to install it in the official documentation.

arm-none-eabi-gcc

arm-none-eabi-gcc is the only currently tested compiler for jerryscript on mbed, and instructions for building can be found as part of the mbed-cli installation instructions above.

make

make is used to automate the process of fetching dependencies, and making sure that mbed-cli is called with the correct arguments.

(optional) jshint

jshint is used to statically check your JavaScript code, as part of the build process. This ensures that pins you are using in your code are available on your chosen target platform.

Python modules

There are multiple Python module dependencies which can be installed with the following command invoked from your jerryscript/targets/mbedos5/tools directory:

pip install -r requirements.txt

If you have no pip installed but your are on an apt-managed system (e.g., Ubuntu), issue the following command first:

apt-get -y install python-pip

(Otherwise, visit pip documentation for more information on how to install pip.)

Quick Start

Once you have all of your dependencies installed, you can build the project as follows:

git clone https://github.com/jerryscript-project/jerryscript
cd jerryscript/targets/mbedos5
make getlibs
# NRF52 Development Kit:
make BOARD=NRF52_DK
# FRDM K64F
make BOARD=K64F

The produced file (in .build/[BOARD]/GCC_ARM) can then be uploaded to your board, and will run when you press reset.

If you make a modification to main.js, you can simply rerun make, and it will remember your previous choice of board:

make