Modify the build method of NuttX target. (#2154)

Modified the Makefile of the NuttX target to build only the application
file (targets/nuttx-stm32f4/jerry-main.c) and not the whole project.
It helps to build JerryScript separately and use the static libs when
building NuttX.
Also modified the README.md to describe the new build process.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
This commit is contained in:
Roland Takacs
2018-01-09 09:34:01 +01:00
committed by Zoltan Herczeg
parent 4e7a9d2d53
commit f833da2c13
5 changed files with 144 additions and 112 deletions
+4 -5
View File
@@ -20,7 +20,6 @@
#include "jerryscript.h"
#include "jerryscript-ext/handler.h"
#include "jerryscript-port.h"
#include "jmem.h"
#include "setjmp.h"
/**
@@ -94,7 +93,7 @@ read_file (const char *file_name, /**< source code */
rewind (file);
uint8_t *buffer = jmem_heap_alloc_block_null_on_error (script_len);
uint8_t *buffer = (uint8_t *) malloc (script_len);
if (buffer == NULL)
{
@@ -108,7 +107,7 @@ read_file (const char *file_name, /**< source code */
if (!bytes_read || bytes_read != script_len)
{
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Error: failed to read file: %s\n", file_name);
jmem_heap_free_block ((void*) buffer, script_len);
free ((void*) buffer);
fclose (file);
return NULL;
@@ -482,12 +481,12 @@ int jerry_main (int argc, char *argv[])
if (jerry_value_has_error_flag (ret_value))
{
print_unhandled_exception (ret_value, source_p);
jmem_heap_free_block ((void*) source_p, source_size);
free ((void*) source_p);
break;
}
jmem_heap_free_block ((void*) source_p, source_size);
free ((void*) source_p);
jerry_release_value (ret_value);
ret_value = jerry_create_undefined ();