targets: zephyr: Update for Zephyr 1.10 which uses CMake-based build. (#2155)

In 1.10, Zephyr RTOS switched to CMake as means to generate application
makefiles. Consequently, drop Makefile, and introduce CMakeLists.txt,
and update master Makefile.zephyr accordingly.

With these changes, take a chance to make following "cosmetic" changes:

1. Make "qemu_x86" board target the default instead of "arduino_101".
Arduino 101 is just one of the boards of many supported by Zephyr
(and thus JerryScript port), while qemu_x86 is something everyone has.

2. Zephyr make target to run QEMU switched from "qemu" to "run".

3. Don't rely that there's zephyr.strip, it's presence is now
board-dependent. The most we can rely on is zephyr.elf.

targets: zephyr: Remove deprecated prj.mdef file.

MDEF files have been deprecated and ignored for few Zephyr releases.

targets: zephyr: Increase main (i.e. interpreter) thread stack size.

qemu_x86 target now has stack guard enabled by default and it trips with
the default stack size. Set it to 2K for now.

targets: zephyr: Makefile.travis: Update for Zephyr 1.10.

Zephyr 1.10 requires SDK 0.9.2 and CMake 3.8.2.

Also, don't hardcode CC path, it depends on a board and choosed
automatically by Zephyr build system.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
This commit is contained in:
Paul Sokolovsky
2018-01-08 10:49:07 +02:00
committed by László Langó
parent e0e6aa0319
commit 290bc22f0c
7 changed files with 69 additions and 85 deletions
+11 -11
View File
@@ -18,7 +18,8 @@ ifeq ($(.DEFAULT_GOAL),)
$(warning no default goal is set)
endif
BOARD ?= arduino_101
BOARD ?= qemu_x86
CONF_FILE = prj.conf
export BOARD
TARGET_ZEPHYR ?= ./targets/zephyr
@@ -41,7 +42,7 @@ ifndef ZEPHYR_BASE
$(error Missing Zephyr base, did you source zephyr-env.sh? )
endif
INTERM = build/$(BOARD)/obj-$(BOARD)
INTERM = build/$(BOARD)/obj
OUTPUT = build/$(BOARD)/zephyr
include $(OUTPUT)/Makefile.export
@@ -94,25 +95,24 @@ endif
make -C $(INTERM) $(COMPONENTS) V=1
$(OUTPUT)/Makefile.export: $(OUTPUT)/include/config/auto.conf
make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) outputexports
$(OUTPUT)/Makefile.export: $(OUTPUT)/Makefile
make --no-print-directory -C $(OUTPUT) outputexports CMAKE_COMMAND=: >$@
$(OUTPUT)/include/config/auto.conf:
make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) initconfig
$(OUTPUT)/Makefile:
mkdir -p $(OUTPUT) && cmake -DBOARD=$(BOARD) -DCONF_FILE=$(CONF_FILE) -B$(OUTPUT) -Htargets/zephyr/
zephyr: jerry
ifdef V
@echo "- ZEPHYR -------------------------------------------------------"
endif
+make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG)
+make -C $(OUTPUT)
@echo "Finished"
@file $(OUTPUT)/zephyr.strip
@size $(OUTPUT)/zephyr.strip
@size $(OUTPUT)/zephyr/zephyr.elf
jerry: $(EXTERNAL_LIB)
@touch $(EXTERNAL_LIB)
GENERIC_TARGETS = qemu qemugdb flash debug debugserver
GENERIC_TARGETS = run qemugdb flash debug debugserver
KCONFIG_TARGETS = \
initconfig config nconfig menuconfig xconfig gconfig \
oldconfig silentoldconfig defconfig savedefconfig \
@@ -127,7 +127,7 @@ $(GENERIC_TARGETS) $(KCONFIG_TARGETS) $(CLEAN_TARGETS):
ifdef V
@echo "- ZEPHYR -------------------------------------------------------"
endif
make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) $@
make -C $(OUTPUT) $@
dfu-x86: all
@- dfu-util -a x86_app -D build/$(BOARD)/zephyr/zephyr.bin; \