Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ matrix:
- env: JOBNAME="RIOT/STM32F4 Build Test"
install: make -f ./targets/riot-stm32f4/Makefile.travis install-noapt
script: make -f ./targets/riot-stm32f4/Makefile.travis script
compiler: clang-3.9
addons:
apt:
packages: [gcc-arm-none-eabi, libnewlib-arm-none-eabi]
sources:
- sourceline: ppa:team-gcc-arm-embedded/ppa
packages: [clang-3.9, gcc-arm-embedded, gcc-multilib]

- env: JOBNAME="Tizen RT/Artik053 Build Test"
addons:
Expand Down
10 changes: 4 additions & 6 deletions targets/riot-stm32f4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ APPLICATION = riot_jerry
# default BOARD enviroment
BOARD ?= stm32f4discovery

# LLVM/Clang-based toolchain
TOOLCHAIN ?= llvm

# path to the RIOT base directory
RIOTBASE ?= $(CURDIR)/../RIOT
# path to the JERRYSCRIPT directory
Expand All @@ -29,11 +32,6 @@ APPDIR ?= $(JERRYDIR)/targets/riot-stm32f4/source
# path to the binary directory
BINDIR ?= $(JERRYDIR)/targets/riot-stm32f4/bin/

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
CFLAGS += -DDEVELHELP

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

Expand All @@ -44,7 +42,7 @@ USEMODULE += shell
USEMODULE += shell_commands

# Add the jerry libs
USEMODULE += libjerrycore libjerryport-minimal libjerryext
USEMODULE += libjerry-core libjerry-port-default-minimal libjerry-ext


include $(RIOTBASE)/Makefile.include
28 changes: 20 additions & 8 deletions targets/riot-stm32f4/Makefile.riot
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,51 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Build and output directories
BUILD_DIR ?= build/riotstm32f4
COPYTARGET ?= targets/riot-stm32f4/bin

# JerryScript configuration
JERRYHEAP ?= 16

EXT_CFLAGS := -D__TARGET_RIOT_STM32F4
# To be defined on the command line of make if Clang is available via a
# different name (e.g., clang-N.M)
CC ?= clang

# Cross-compilation settings for Clang
EXT_CFLAGS := -target arm-none-eabi
EXT_CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4
EXT_CFLAGS += -Wno-error=format=
EXT_CFLAGS += -isystem /usr/arm-none-eabi/include
EXT_CFLAGS += $(addprefix -isystem $(lastword $(sort $(wildcard /usr/lib/gcc/arm-none-eabi/*/))), include include-fixed)
EXT_CFLAGS += -nostdinc

# For ABI compatibility with RIOT-OS
EXT_CFLAGS += -fshort-enums


.PHONY: libjerry riot-jerry flash clean

all: libjerry riot-jerry

libjerry:
mkdir -p $(BUILD_DIR)
mkdir -p $(COPYTARGET)
cmake -B$(BUILD_DIR) -H./ \
-DCMAKE_SYSTEM_NAME=RIOT \
-DCMAKE_SYSTEM_PROCESSOR=armv7l \
-DCMAKE_C_COMPILER=arm-none-eabi-gcc \
-DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_C_COMPILER_WORKS=TRUE \
-DENABLE_LTO=OFF \
-DENABLE_ALL_IN_ONE=OFF \
-DJERRY_LIBM=OFF \
-DJERRY_CMDLINE=OFF \
-DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \
-DMEM_HEAP_SIZE_KB=$(JERRYHEAP)

make -C$(BUILD_DIR) jerry-core jerry-port-default-minimal jerry-ext
cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET)/libjerrycore.a
cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(COPYTARGET)/libjerryport-minimal.a
cp $(BUILD_DIR)/lib/libjerry-ext.a $(COPYTARGET)/libjerryext.a

mkdir -p $(COPYTARGET)
cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET)
cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(COPYTARGET)
cp $(BUILD_DIR)/lib/libjerry-ext.a $(COPYTARGET)

riot-jerry: libjerry
make -f ./targets/riot-stm32f4/Makefile
Expand Down
4 changes: 2 additions & 2 deletions targets/riot-stm32f4/Makefile.travis
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ all:

# Install cross-compiler via apt.
install-apt-get-deps:
sudo apt-get install -q -y gcc-arm-none-eabi
sudo apt-get install -q -y clang-3.9 gcc-arm-embedded gcc-multilib

# Fetch RIOT OS repository.
install-clone-riot:
git clone git://github.com/RIOT-OS/RIOT.git ../RIOT -b 2017.10
git clone git://github.com/RIOT-OS/RIOT.git ../RIOT -b 2018.07

# Perform all the necessary (JerryScript-independent) installation steps.
install-noapt: install-clone-riot
Expand Down