1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/jerryscript/Makefile.jerryscript
cladmi cf12022d63
pkg/jerryscript: fix jerryscript not using system includes
Jerryscript was never using INCLUDES so never having the 'newlib-nano' or llvm
includes. It prevented working with `llvm`.

Disable unsupported warnings for ESP32 and ESP8266 newlib that show when
using system includes.
 * tested newlib version for ESP32 is 2.2.0
 * tested newlib version for ESP8266 is 3.0.0
2018-12-19 17:12:31 +01:00

49 lines
1.6 KiB
Makefile

BUILD_DIR ?= $(BINDIR)/jerryscript
JERRYHEAP ?= 16
EXT_CFLAGS :=-D__TARGET_RIOT
ifeq ($(TOOLCHAIN)_$(BOARD),llvm_native)
EXT_CFLAGS :=-D__TARGET_RIOT -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
endif
.PHONY: all libjerry
all: libjerry
libjerry:
cmake -B$(BUILD_DIR) -H./ \
-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_LIBC=OFF \
-DJERRY_LIBM=OFF \
-DJERRY_CMDLINE=OFF \
-DHAVE_TIME_H=0 \
-DEXTERNAL_COMPILE_FLAGS="$(INCLUDES) $(EXT_CFLAGS)" \
-DMEM_HEAP_SIZE_KB=$(JERRYHEAP)
"$(MAKE)" -C $(BUILD_DIR) jerry-core jerry-ext jerry-port-default-minimal
cp $(BUILD_DIR)/lib/libjerry-core.a $(BINDIR)/jerryscript.a
cp $(BUILD_DIR)/lib/libjerry-ext.a $(BINDIR)/jerryscript-ext.a
cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(BINDIR)/jerryport-minimal.a