Improve Js2C converter (#1408)
* Rename 'jerry_targetjs.h' to 'jerry-targetjs.h', because we use dashes in filen ames instead of underscores. * Made destination and js souce directory configurable. * Updated esp8266 target to the recent changes. * Updated mbed and mbedos5 target to the recent changes. JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -5,4 +5,4 @@ mbed-events
|
||||
mbed_settings.py
|
||||
js/pins.js
|
||||
source/pins.cpp
|
||||
source/jerry_targetjs.h
|
||||
source/jerry-targetjs.h
|
||||
|
||||
@@ -52,13 +52,13 @@ MBED_CLI_FLAGS += -D "CONFIG_MEM_HEAP_AREA_SIZE=(1024*$(HEAPSIZE))"
|
||||
MBED_CLI_FLAGS += -t GCC_ARM
|
||||
|
||||
.PHONY: all js2c getlibs rebuild library
|
||||
all: source/jerry_targetjs.h source/pins.cpp .mbed ../../.mbedignore
|
||||
all: source/jerry-targetjs.h source/pins.cpp .mbed ../../.mbedignore
|
||||
mbed target $(BOARD)
|
||||
mbed compile $(MBED_CLI_FLAGS)
|
||||
|
||||
library: .mbed ../../.mbedignore
|
||||
# delete encoded js code if it exists
|
||||
rm -f source/jerry_targetjs.h
|
||||
rm -f source/jerry-targetjs.h
|
||||
mbed target $(BOARD)
|
||||
mbed compile $(MBED_CLI_FLAGS) --library
|
||||
|
||||
@@ -68,13 +68,13 @@ clean:
|
||||
js2c: js/main.js js/flash_leds.js
|
||||
python ../tools/js2c.py --ignore pins.js
|
||||
|
||||
source/pins.cpp:
|
||||
source/pins.cpp:
|
||||
python tools/generate_pins.py ${BOARD}
|
||||
|
||||
ifeq ($(NO_JS),0)
|
||||
source/jerry_targetjs.h: js2c
|
||||
source/jerry-targetjs.h: js2c
|
||||
else
|
||||
source/jerry_targetjs.h: ;
|
||||
source/jerry-targetjs.h: ;
|
||||
endif
|
||||
|
||||
getlibs: .mbed
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
#include "jerryscript-mbed-launcher/launcher.h"
|
||||
#include "jerryscript-mbed-launcher/setup.h"
|
||||
|
||||
#include "jerry_targetjs.h"
|
||||
#include "jerry-targetjs.h"
|
||||
|
||||
DECLARE_JS_CODES;
|
||||
|
||||
/**
|
||||
* load_javascript
|
||||
*
|
||||
* Parse and run javascript files specified in jerry_targetjs.h
|
||||
* Parse and run javascript files specified in jerry-targetjs.h
|
||||
*/
|
||||
static int load_javascript() {
|
||||
for (int src = 0; js_codes[src].source; src++) {
|
||||
|
||||
Reference in New Issue
Block a user