Skip to content

Commit befa7a8

Browse files
author
Zsolt Borbély
authored
[nuttx-stm32f4] Use jerry-libm instead of the math library in NuttX (#1744)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
1 parent 8d99e73 commit befa7a8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

targets/nuttx-stm32f4/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
2828
STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
2929
CFLAGS += -std=c99 -DJERRY_NDEBUG -DJERRY_JS_PARSER '-DCONFIG_MEM_HEAP_AREA_SIZE=$(CONFIG_JERRYSCRIPT_HEAPSIZE)' -DCONFIG_DISABLE_ES2015_PROMISE_BUILTIN
3030
CFLAGS += -I$(ROOT_DIR)/ $(shell find $(ROOT_DIR)/jerryscript/jerry-core -type d | sed -r -e 's/^/-I/g')
31+
CFLAGS += -I$(ROOT_DIR)/jerryscript/jerry-libm/include
3132

3233
ifeq ($(CONFIG_JERRYSCRIPT_MEM_STATS),y)
3334
CFLAGS += -DJMEM_STATS
@@ -45,11 +46,14 @@ endif
4546

4647
.PHONY: jerry_core_allin.c
4748
jerry_core_allin.c:
48-
echo '#include "jerryscript/jerry-libm/nextafter.c"' > jerry_core_allin.c
49-
find $(ROOT_DIR)/jerryscript/jerry-core -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' >> jerry_core_allin.c
49+
find $(ROOT_DIR)/jerryscript/jerry-core -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' > jerry_core_allin.c
50+
51+
.PHONY: jerry_libm_allin.c
52+
jerry_libm_allin.c:
53+
find $(ROOT_DIR)/jerryscript/jerry-libm -name "*.c" | sed -r -e 's/(\.\.\/)*(.+)/#include "\2"/g' > jerry_libm_allin.c
5054

5155
ASRCS = setjmp.S
52-
CSRCS = jerry_core_allin.c
56+
CSRCS = jerry_core_allin.c jerry_libm_allin.c
5357
MAINSRC = jerry_main.c
5458

5559
CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)

targets/nuttx-stm32f4/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ We must set the following options:
5656

5757
* Change `Build Setup -> Build Host Platform` from _Windows_ to _Linux_
5858
* Enable `System Type -> FPU support`
59-
* Enable `Library Routines -> Standard Math library`
6059
* Enable `Application Configuration -> Interpreters -> JerryScript`
6160

6261
If you get `kconfig-mconf: not found` error when you run `make menuconfig` you may have to install kconfig-frontends:

0 commit comments

Comments
 (0)