1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/jerryscript/Makefile

68 lines
2.4 KiB
Makefile
Raw Normal View History

2017-03-22 16:19:49 +01:00
PKG_NAME=jerryscript
PKG_URL=https://github.com/jerryscript-project/jerryscript.git
# 2.4.0
PKG_VERSION=8ba0d1b6ee5a065a42f3b306771ad8e3c0d819bc
2017-03-22 16:19:49 +01:00
PKG_LICENSE=Apache-2.0
include $(RIOTBASE)/pkg/pkg.mk
2017-03-22 16:19:49 +01:00
2021-10-02 15:03:09 +02:00
JERRY_PROFILE ?= minimal # Other possible values are es.next, es5.1 and es2015-subset
JERRY_HEAP ?= 16 # kB
JERRY_STACK ?= 1 # kB
JERRY_GC_LIMIT ?= 0 # Use default value, e.g. 1/32 of total heap size
JERRY_GC_MARK_LIMIT ?= 8 # maximum recursion depth during GC mark phase
2020-06-13 16:09:36 +02:00
EXT_CFLAGS := -D__TARGET_RIOT
2021-11-05 22:34:21 +01:00
CFLAGS += -Wno-cast-align
2020-06-13 16:09:36 +02:00
# disable warnings when compiling with LLVM for board native
ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
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 ESP-IDF uses #include_next that causes errors when compiling with warnings
# that are enabled by jerryscript build system so disable them for these CPUs:
EXT_CFLAGS += -Wno-pedantic
2020-06-13 16:09:36 +02:00
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
endif
all: $(BINDIR)/jerryscript.a
2020-06-13 16:09:36 +02:00
$(BINDIR)/jerryscript.a: $(PKG_BUILD_DIR)/Makefile
2021-10-02 15:03:09 +02:00
"$(MAKE)" -C $(PKG_BUILD_DIR) jerry-core jerry-ext jerry-port-default
@cp $(PKG_BUILD_DIR)/lib/libjerry-core.a $(BINDIR)/jerryscript.a
@cp $(PKG_BUILD_DIR)/lib/libjerry-ext.a $(BINDIR)/jerryscript-ext.a
2021-10-02 15:03:09 +02:00
@cp $(PKG_BUILD_DIR)/lib/libjerry-port-default.a $(BINDIR)/jerryscript-port-default.a
2020-06-13 16:09:36 +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 \
2021-10-02 15:03:09 +02:00
-DENABLE_AMALGAM=OFF \
2020-06-13 16:09:36 +02:00
-DHAVE_TIME_H=0 \
-DEXTERNAL_COMPILE_FLAGS="$(INCLUDES) $(EXT_CFLAGS)" \
2021-10-02 15:03:09 +02:00
-DJERRY_MATH=OFF \
-DJERRY_PROFILE=$(JERRY_PROFILE) \
-DJERRY_CMDLINE=OFF \
-DJERRY_VALGRIND=OFF \
-DJERRY_GC_LIMIT=$(JERRY_GC_LIMIT) \
-DJERRY_GC_MARK_LIMIT=$(JERRY_GC_MARK_LIMIT) \
-DJERRY_STACK_LIMIT=$(JERRY_STACK) \
-DJERRY_GLOBAL_HEAP_SIZE=$(JERRY_HEAP)
2020-06-13 16:09:36 +02:00
clean::
@rm -rf $(PKG_BUILD_DIR)