• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright JS Foundation and other contributors, http://js.foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15-include $(TOPDIR)/Make.defs
16
17# Jerryscript built-in application information.
18CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
19CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)
20CONFIG_JERRYSCRIPT_STACKSIZE ?= 16384
21
22PROGNAME = $(CONFIG_JERRYSCRIPT_PROGNAME)
23PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
24STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
25
26# Path to the JerryScript project. If not specified, it is supposed
27# that JerryScript is located next to the nuttx-apps folder.
28JERRYSCRIPT_ROOT_DIR ?= ../../../jerryscript
29
30CFLAGS += -std=c99
31CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-core/include
32CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-ext/include
33CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-libm/include
34
35# These libs should be copied from the JerryScript project.
36LIBS = libjerry-core.a libjerry-ext.a libjerry-libm.a
37
38APPNAME = jerry
39ASRCS = setjmp.S
40CSRCS = jerry_port.c
41MAINSRC = jerry_main.c
42
43.PHONY: copylibs
44copylibs:
45	cp $(JERRYSCRIPT_ROOT_DIR)/build/lib/lib*.a .
46
47$(LIBS): copylibs
48	$(firstword $(AR)) x $@
49
50.PHONY: updateobjs
51updateobjs:
52	$(eval OBJS += $(shell find . -name "*.obj"))
53
54.PHONY: cleanlibs
55cleanlibs: updateobjs
56	rm -f $(OBJS)
57
58clean:: cleanlibs
59
60.built: $(LIBS) updateobjs
61
62include $(APPDIR)/Application.mk
63