1# Copyright JS Foundation and other contributors, http://js.foundation 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15 16# Default target for running the build test outside the Travis CI environment. 17all: 18 $(MAKE) install 19 $(MAKE) script 20 21 22## Targets for installing build dependencies of the Zephyr JerryScript target. 23 24# Install tools via apt. 25install-apt-get-deps: 26 sudo apt-get install -q -y gperf dfu-util device-tree-compiler 27 28# Install Zephyr SDK. 29install-zephyr-sdk: 30 wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.10.0/zephyr-sdk-0.10.0-setup.run -O ../zephyr-sdk-0.10.0-setup.run 31 sh ../zephyr-sdk-0.10.0-setup.run -- -y -d $(CURDIR)/../zephyr-sdk-0.10.0 32 33# Fetch Zephyr Project repository and install python dependencies. 34install-zephyr: 35 git clone https://github.com/zephyrproject-rtos/zephyr.git ../zephyr -b v1.14-branch 36 pip3 install -U pip 37 pip3 install -U setuptools 38 pip3 install -r ../zephyr/scripts/requirements.txt 39 40# Install recent CMake 41install-cmake: 42 pip install cmake 43 cmake --version 44 45# Perform all the necessary (JerryScript-independent) installation steps. 46install-noapt: install-zephyr-sdk install-zephyr install-cmake 47install: install-apt-get-deps install-noapt 48 49 50## Targets for building Zephyr with JerryScript. 51 52# Build the firmware (Zephyr with JerryScript). 53SHELL=bash 54script: 55 export ZEPHYR_TOOLCHAIN_VARIANT=zephyr && \ 56 export ZEPHYR_SDK_INSTALL_DIR=$(CURDIR)/../zephyr-sdk-0.10.0 && \ 57 source ../zephyr/zephyr-env.sh && \ 58 $(MAKE) -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 59