From 47552609302aa5af7d5bf2be8d647de6c5b94edb Mon Sep 17 00:00:00 2001 From: "e.gavrin" Date: Tue, 1 Jul 2014 19:23:24 +0400 Subject: [PATCH] add generated.h with literal of js app --- Makefile | 6 ++---- src/generated.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 src/generated.h diff --git a/Makefile b/Makefile index 01955023e..aa5b4b0dc 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ # limitations under the License. TARGET ?= jerry - +#CROSS_COMPILE ?= arm-none-eabi- OBJ_DIR = obj SOURCES = \ @@ -25,8 +25,6 @@ INCLUDES = -I src OBJS = $(sort \ $(patsubst %.c,./$(OBJ_DIR)/%.o,$(notdir $(SOURCES)))) -#CROSS_COMPILE ?= arm-none-eabi- - CC = $(CROSS_COMPILE)gcc LD = $(CROSS_COMPILE)ld OBJDUMP = $(CROSS_COMPILE)objdump @@ -45,7 +43,7 @@ CFLAGS += -Wstrict-prototypes -Wmissing-prototypes #CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard #CFLAGS += -ffunction-sections -fdata-sections -DEBUG_OPTIONS = -fsanitize=address -g3 -O0 -DDEBUG +DEBUG_OPTIONS = -g3 -O0 -DDEBUG #-fsanitize=address RELEASE_OPTIONS = -Os -Werror .PHONY: all debug release clean install test diff --git a/src/generated.h b/src/generated.h new file mode 100644 index 000000000..75a92745a --- /dev/null +++ b/src/generated.h @@ -0,0 +1,54 @@ +/* Copyright 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +static const char* generated_source = "" +"// AST\n" +"// ECMA has no way of including files. Do we need such feature?\n" +"// EG: Not in initial version\n" +"require (leds);\n" +"\n" +"function LEDsOn () {\n" +"LEDOn (LED3);\n" +"LEDOn (LED6);\n" +"LEDOn (LED7);\n" +"LEDOn (LED4);\n" +"LEDOn (LED10);\n" +"LEDOn (LED8);\n" +"LEDOn (LED9);\n" +"LEDOn (LED5);\n" +"}\n" +"\n" +"function LEDsOff () {\n" +"LEDOff (LED3);\n" +"LEDOff (LED6);\n" +"LEDOff (LED7);\n" +"LEDOff (LED4);\n" +"LEDOff (LED10);\n" +"LEDOff (LED8);\n" +"LEDOff (LED9);\n" +"LEDOff (LED5);\n" +"}\n" +"\n" +"/*\n" +"IMHO we don't need this function in our code,\n" +"we may perform lazy LEDs initialization.\n" +"*/\n" +"// initLEDs ();\n" +"\n" +"while (true) {\n" +"setTimeout (LEDsOn, 500);\n" +"setTimeout (LEDsOff, 500);\n" +"}\n" +;