mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Rationale: - There is no port under targets/ that would use it. All of them turn it off when building. - That's no surprise, as jerry-libc supports no barebone MCUs but posix targets with syscalls only. Actually, that's Linux only, because macOS builds have turned off the use of jerry-libc a while ago. - And there is no point in maintaining a highly restricted set of libc functions: as soon as someone wants to use JerryScript in a scenario that needs more functions than jerry-main, they have to choose a different libc (most problably the compiler's default one). I think that we should not keep supporting an otherwise unused library for the purposes of jerry-main on arm/x86/x64-linux only. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
71 lines
2.9 KiB
Makefile
71 lines
2.9 KiB
Makefile
# Copyright JS Foundation and other contributors, http://js.foundation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
|
|
# Default target for running the build test outside the Travis CI environment.
|
|
all:
|
|
$(MAKE) install
|
|
$(MAKE) script
|
|
|
|
|
|
## Targets for installing build dependencies of the NuttX JerryScript target.
|
|
|
|
# Install cross-compiler and tools via apt.
|
|
install-apt-get-deps:
|
|
sudo apt-get install -q -y gcc-arm-none-eabi gperf
|
|
|
|
# Fetch and build kconfig-frontends (kconfig-conf) from nuttx/tools.
|
|
LOCAL_INSTALL:=$(CURDIR)/../local/
|
|
|
|
install-kconfig:
|
|
git clone https://bitbucket.org/nuttx/tools.git ../tools
|
|
mkdir -p $(LOCAL_INSTALL)
|
|
# FIXME: 'autoreconf --force --install' is a workaround after
|
|
# https://bitbucket.org/nuttx/tools/commits/164450f982b404fdc2b3233db51dc3eaa1f08b7f
|
|
cd ../tools/kconfig-frontends && autoreconf --force --install && ./configure --disable-mconf --disable-nconf --disable-gconf --disable-qconf --disable-utils --disable-shared --enable-static --prefix=$(LOCAL_INSTALL)
|
|
$(MAKE) -C ../tools/kconfig-frontends
|
|
$(MAKE) -C ../tools/kconfig-frontends install
|
|
|
|
# Fetch nuttx/{apps,nuttx} repositories.
|
|
install-clone-nuttx:
|
|
git clone https://bitbucket.org/nuttx/apps.git ../apps -b nuttx-7.22
|
|
git clone https://bitbucket.org/nuttx/nuttx.git ../nuttx -b nuttx-7.22
|
|
|
|
# Perform all the necessary (JerryScript-independent) installation steps.
|
|
install-noapt: install-kconfig install-clone-nuttx
|
|
install: install-apt-get-deps install-noapt
|
|
|
|
|
|
## Targets for building NuttX with JerryScript.
|
|
|
|
# Build JerryScript.
|
|
script-build-jerryscript:
|
|
tools/build.py --clean --toolchain cmake/toolchain_mcu_stm32f4.cmake --profile=es2015-subset --jerry-cmdline OFF --lto OFF --jerry-libm ON --all-in-one ON --mem-heap 70 --compile-flag='--sysroot=../nuttx'
|
|
|
|
# Link in the NuttX JerryScript target directory under the NuttX apps tree.
|
|
script-add-jerryscript-app:
|
|
ln -s ../../jerryscript/targets/nuttx-stm32f4 ../apps/interpreters/jerryscript
|
|
|
|
# Configure USB shell.
|
|
script-configure-usbnsh:
|
|
cd ../nuttx/tools && PATH=$(LOCAL_INSTALL)/bin:$$PATH ./configure.sh stm32f4discovery/usbnsh
|
|
|
|
# Configure and build the firmware (NuttX with JerryScript).
|
|
script: script-build-jerryscript script-add-jerryscript-app script-configure-usbnsh
|
|
echo 'CONFIG_HOST_LINUX=y' >> ../nuttx/.config
|
|
echo 'CONFIG_ARCH_FPU=y' >> ../nuttx/.config
|
|
echo 'CONFIG_JERRYSCRIPT=y'>> ../nuttx/.config
|
|
PATH=$(LOCAL_INSTALL)/bin:$$PATH $(MAKE) -C ../nuttx olddefconfig
|
|
PATH=$(LOCAL_INSTALL)/bin:$$PATH $(MAKE) -C ../nuttx
|