2017-03-22 16:19:49 +01:00
|
|
|
PKG_NAME=jerryscript
|
|
|
|
PKG_URL=https://github.com/jerryscript-project/jerryscript.git
|
2018-08-21 11:21:05 +02:00
|
|
|
PKG_VERSION=6e94414f9c3ad9b77c4635a0ca9e796752a205f0
|
2017-03-22 16:19:49 +01:00
|
|
|
PKG_LICENSE=Apache-2.0
|
|
|
|
|
2019-10-02 12:47:02 +02:00
|
|
|
include $(RIOTBASE)/pkg/pkg.mk
|
2017-03-22 16:19:49 +01:00
|
|
|
|
2017-08-30 12:34:50 +02:00
|
|
|
CFLAGS += -Wno-implicit-fallthrough
|
|
|
|
|
2020-06-13 16:09:36 +02:00
|
|
|
JERRYHEAP ?= 16
|
|
|
|
|
|
|
|
EXT_CFLAGS := -D__TARGET_RIOT
|
|
|
|
|
2017-12-19 12:21:42 +01:00
|
|
|
# disable warnings when compiling with LLVM for board native
|
|
|
|
ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
|
2018-08-22 16:16:28 +02:00
|
|
|
CFLAGS += -Wno-macro-redefined -Wno-gnu-folding-constant
|
2020-06-13 16:09:36 +02:00
|
|
|
EXT_CFLAGS += -Wno-conversion
|
|
|
|
else ifeq ($(OS)_$(BOARD),FreeBSD_native)
|
|
|
|
EXT_CFLAGS += -Wno-conversion
|
|
|
|
else ifeq (esp32,$(CPU))
|
|
|
|
# The esp32 C newlib version 2.2.0 has errors when compiling with warnings
|
|
|
|
# that are enabled by jerryscript build system so disable them for this cpu:
|
|
|
|
# * -Wundef: stdio.h: `__GNU_VISIBLE` and `__BSD_VISIBLE` are not defined
|
|
|
|
EXT_CFLAGS += -Wno-undef -Wno-error=undef
|
|
|
|
else ifeq (esp8266,$(CPU))
|
|
|
|
# The esp8266 C newlib version 3.0.0 has errors when compiling with warnings
|
|
|
|
# that are enabled by jerryscript build system so disable them for this cpu:
|
|
|
|
# * -Wundef
|
|
|
|
# * -Wconversion
|
|
|
|
# * -Wsign-conversion
|
|
|
|
EXT_CFLAGS += -Wno-undef -Wno-error=undef
|
|
|
|
EXT_CFLAGS += -Wno-conversion -Wno-error=conversion
|
|
|
|
EXT_CFLAGS += -Wno-sign-conversion -Wno-error=sign-conversion
|
2017-12-19 12:21:42 +01:00
|
|
|
endif
|
|
|
|
|
2020-06-13 16:09:36 +02:00
|
|
|
.PHONY: libjerry
|
|
|
|
|
|
|
|
all: libjerry
|
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
libjerry: $(PKG_BUILD_DIR)/Makefile
|
|
|
|
"$(MAKE)" -C $(PKG_BUILD_DIR) jerry-core jerry-ext jerry-port-default-minimal
|
|
|
|
@cp $(PKG_BUILD_DIR)/lib/libjerry-core.a $(BINDIR)/jerryscript.a
|
|
|
|
@cp $(PKG_BUILD_DIR)/lib/libjerry-ext.a $(BINDIR)/jerryscript-ext.a
|
|
|
|
@cp $(PKG_BUILD_DIR)/lib/libjerry-port-default-minimal.a $(BINDIR)/jerryport-minimal.a
|
2020-06-13 16:09:36 +02:00
|
|
|
|
2020-06-13 20:59:41 +02:00
|
|
|
$(PKG_BUILD_DIR)/Makefile:
|
|
|
|
cmake -B$(PKG_BUILD_DIR) -H$(PKG_SOURCE_DIR) \
|
2020-06-13 16:09:36 +02:00
|
|
|
-DCMAKE_SYSTEM_NAME=RIOT \
|
|
|
|
-DCMAKE_SYSTEM_PROCESSOR="$(MCPU)" \
|
|
|
|
-DCMAKE_C_COMPILER=$(CC) \
|
|
|
|
-DCMAKE_C_COMPILER_WORKS=TRUE \
|
|
|
|
-DENABLE_LTO=OFF \
|
|
|
|
-DFEATURE_VALGRIND=OFF \
|
|
|
|
-DENABLE_ALL_IN_ONE=OFF \
|
|
|
|
-DJERRY_LIBM=OFF \
|
|
|
|
-DJERRY_CMDLINE=OFF \
|
|
|
|
-DHAVE_TIME_H=0 \
|
|
|
|
-DEXTERNAL_COMPILE_FLAGS="$(INCLUDES) $(EXT_CFLAGS)" \
|
|
|
|
-DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
|
|
|
|
|
|
|
|
clean::
|
2020-06-13 20:59:41 +02:00
|
|
|
@rm -rf $(PKG_BUILD_DIR)
|