add generated.h with literal of js app

This commit is contained in:
e.gavrin 2014-07-01 19:23:24 +04:00
parent 6e88d76fec
commit 4755260930
2 changed files with 56 additions and 4 deletions

View File

@ -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

54
src/generated.h Normal file
View File

@ -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"
;