preparation for MCU porting

This commit is contained in:
e.gavrin
2014-07-08 15:43:26 +04:00
parent 68e6a6241b
commit 7ef551fdde
3 changed files with 23 additions and 28 deletions
+15 -21
View File
@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
TARGET ?= jerry TARGET ?= jerry
CROSS_COMPILE ?= arm-none-eabi- CROSS_COMPILE ?=
OBJ_DIR = obj OBJ_DIR = obj
OUT_DIR = ./out OUT_DIR = ./out
@@ -58,18 +58,12 @@ OBJS = \
$(sort \ $(sort \
$(patsubst %.c,./$(OBJ_DIR)/%.o,$(notdir $(MAIN_MODULE_SRC) $(SOURCES)))) $(patsubst %.c,./$(OBJ_DIR)/%.o,$(notdir $(MAIN_MODULE_SRC) $(SOURCES))))
CC = gcc#-4.9 CC = $(CROSS_COMPILE)gcc
LD = ld LD = $(CROSS_COMPILE)ld
OBJDUMP = objdump OBJDUMP = $(CROSS_COMPILE)objdump
OBJCOPY = objcopy OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = size SIZE = $(CROSS_COMPILE)size
STRIP = strip STRIP = $(CROSS_COMPILE)strip
CROSS_CC = $(CROSS_COMPILE)gcc#-4.9
CROSS_LD = $(CROSS_COMPILE)ld
CROSS_OBJDUMP = $(CROSS_COMPILE)objdump
CROSS_OBJCOPY = $(CROSS_COMPILE)objcopy
CROSS_SIZE = $(CROSS_COMPILE)size
# General flags # General flags
CFLAGS ?= $(INCLUDES) -std=c99 #-fdiagnostics-color=always CFLAGS ?= $(INCLUDES) -std=c99 #-fdiagnostics-color=always
@@ -79,33 +73,33 @@ CFLAGS ?= $(INCLUDES) -std=c99 #-fdiagnostics-color=always
#CFLAGS += -Wstrict-prototypes -Wmissing-prototypes #CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
# Flags for MCU # Flags for MCU
#CFLAGS += -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb MCU_CFLAGS += -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb
#CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard MCU_CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
#CFLAGS += -ffunction-sections -fdata-sections MCU_CFLAGS += -ffunction-sections -fdata-sections
DEBUG_OPTIONS = -g3 -O0 -DDEBUG# -fsanitize=address DEBUG_OPTIONS = -g3 -O0 -DDEBUG #-fsanitize=address
RELEASE_OPTIONS = -Os -Werror -DNDEBUG RELEASE_OPTIONS = -Os -Werror -DNDEBUG
DEFINES = -DMEM_HEAP_CHUNK_SIZE=256 -DMEM_HEAP_AREA_SIZE=32768 DEFINES = -DMEM_HEAP_CHUNK_SIZE=256 -DMEM_HEAP_AREA_SIZE=32768
TARGET_HOST = -D__HOST TARGET_HOST = -D__HOST
TARGET_MCU = -D__MCU TARGET_MCU = -D__MCU
.PHONY: all debug release clean tests check install .PHONY: all debug debug.stm32f3 release clean tests check install
all: clean debug release check all: clean debug release check
debug: debug: clean
mkdir -p $(OUT_DIR)/debug.host/ mkdir -p $(OUT_DIR)/debug.host/
$(CC) $(CFLAGS) $(DEBUG_OPTIONS) $(DEFINES) $(TARGET_HOST) \ $(CC) $(CFLAGS) $(DEBUG_OPTIONS) $(DEFINES) $(TARGET_HOST) \
$(SOURCES) $(MAIN_MODULE_SRC) -o $(OUT_DIR)/debug.host/$(TARGET) $(SOURCES) $(MAIN_MODULE_SRC) -o $(OUT_DIR)/debug.host/$(TARGET)
release: release: clean
mkdir -p $(OUT_DIR)/release.host/ mkdir -p $(OUT_DIR)/release.host/
$(CC) $(CFLAGS) $(RELEASE_OPTIONS) $(DEFINES) $(TARGET_HOST) \ $(CC) $(CFLAGS) $(RELEASE_OPTIONS) $(DEFINES) $(TARGET_HOST) \
$(SOURCES) $(MAIN_MODULE_SRC) -o $(OUT_DIR)/release.host/$(TARGET) $(SOURCES) $(MAIN_MODULE_SRC) -o $(OUT_DIR)/release.host/$(TARGET)
$(STRIP) $(OUT_DIR)/release.host/$(TARGET) $(STRIP) $(OUT_DIR)/release.host/$(TARGET)
tests: tests: clean
mkdir -p $(OUT_DIR)/tests.host/ mkdir -p $(OUT_DIR)/tests.host/
for unit_test in $(UNITTESTS); \ for unit_test in $(UNITTESTS); \
do \ do \
+3
View File
@@ -23,6 +23,7 @@
#endif #endif
#include "opcodes.h" #include "opcodes.h"
#include "ecma-globals.h"
OPCODE __program[128]; OPCODE __program[128];
@@ -31,6 +32,8 @@ opfunc __opfuncs[LAST_OP];
struct __int_data struct __int_data
{ {
int pos; int pos;
ecma_Object_t *pThisBinding; /**< this binding for current context */
ecma_Object_t *pLexEnv; /**< current lexical environment */
int *root_op_addr; int *root_op_addr;
}; };
+5 -7
View File
@@ -390,13 +390,11 @@ OP_CODE_DECL (loop_postcond, T_IDX_IDX,
//// TODO //// TODO
// Variable declarations // Variable declaration
OP_CODE_DECL (decl_var, T_IDX,
variable)
// TODO New constructor // TODO New constructor
#endif /* OPCODE_STRUCTURES_H */
#endif /* OPCODE_STRUCTURES_H */