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
Gaëtan Harter 6a170583d6
pkg/jerryscript: namespace BUILD_DIR variable
BUILD_DIR was introduced but the variable was already used by
`pkg/jerryscript` so there is a name collision.
Namespace it to prevent issues.
2019-01-16 17:47:12 +01:00

49 lines
1.7 KiB
Makefile

JERRYSCRIPT_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$(JERRYSCRIPT_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 $(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