2019-01-16 17:47:12 +01:00
|
|
|
JERRYSCRIPT_BUILD_DIR ?= $(BINDIR)/jerryscript
|
2017-03-22 16:19:49 +01:00
|
|
|
|
|
|
|
JERRYHEAP ?= 16
|
|
|
|
|
2017-12-19 12:22:48 +01:00
|
|
|
EXT_CFLAGS :=-D__TARGET_RIOT
|
2017-03-22 16:19:49 +01:00
|
|
|
|
2018-11-29 09:52:45 +01:00
|
|
|
ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
|
|
|
|
EXT_CFLAGS :=-D__TARGET_RIOT -Wno-conversion
|
2018-08-22 16:31:51 +02:00
|
|
|
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
|
2018-11-29 09:52:45 +01:00
|
|
|
endif
|
|
|
|
|
2018-08-22 16:00:28 +02:00
|
|
|
.PHONY: all libjerry
|
2017-03-22 16:19:49 +01:00
|
|
|
|
2018-08-22 16:00:28 +02:00
|
|
|
all: libjerry
|
2017-03-22 16:19:49 +01:00
|
|
|
|
|
|
|
libjerry:
|
2019-01-16 17:47:12 +01:00
|
|
|
cmake -B$(JERRYSCRIPT_BUILD_DIR) -H./ \
|
2017-12-19 12:22:48 +01:00
|
|
|
-DCMAKE_SYSTEM_NAME=RIOT \
|
|
|
|
-DCMAKE_SYSTEM_PROCESSOR="$(MCPU)" \
|
|
|
|
-DCMAKE_C_COMPILER=$(CC) \
|
|
|
|
-DCMAKE_C_COMPILER_WORKS=TRUE \
|
2017-03-22 16:19:49 +01:00
|
|
|
-DENABLE_LTO=OFF \
|
|
|
|
-DFEATURE_VALGRIND=OFF \
|
2017-12-19 12:22:48 +01:00
|
|
|
-DENABLE_ALL_IN_ONE=OFF \
|
2017-03-22 16:19:49 +01:00
|
|
|
-DJERRY_LIBC=OFF \
|
2017-04-28 14:15:53 +02:00
|
|
|
-DJERRY_LIBM=OFF \
|
2017-12-19 12:22:48 +01:00
|
|
|
-DJERRY_CMDLINE=OFF \
|
2018-08-21 18:44:58 +02:00
|
|
|
-DHAVE_TIME_H=0 \
|
2018-08-22 16:31:51 +02:00
|
|
|
-DEXTERNAL_COMPILE_FLAGS="$(INCLUDES) $(EXT_CFLAGS)" \
|
2017-03-22 16:19:49 +01:00
|
|
|
-DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
|
|
|
|
|
2019-01-16 17:47:12 +01:00
|
|
|
"$(MAKE)" -C $(JERRYSCRIPT_BUILD_DIR) jerry-core jerry-ext jerry-port-default-minimal
|
|
|
|
cp $(JERRYSCRIPT_BUILD_DIR)/lib/libjerry-core.a $(BINDIR)/jerryscript.a
|
|
|
|
cp $(JERRYSCRIPT_BUILD_DIR)/lib/libjerry-ext.a $(BINDIR)/jerryscript-ext.a
|
|
|
|
cp $(JERRYSCRIPT_BUILD_DIR)/lib/libjerry-port-default-minimal.a $(BINDIR)/jerryport-minimal.a
|