d0143adc82
* Replace JERRY_JS_PARSER feature guard with JERRY_DISABLE_JS_PARSER All feature guards of jerry-core are deciding about the inclusion or exclusion of a feature based on the state (defined or undefined) of a macro -- except for the JS parser guard, which requires `JERRY_JS_PARSER` to be defined with a value of either 0 or 1. This has some issues: - The engine cannot be built with a "clean" compiler invocation, i.e., without any `-D` command line macro definitions. This is painful for targets that must use a different build system from the project's own python/cmake-based one. - Some build systems in targets and even some code in jerry-code are already confused about the different semantics of `JERRY_JS_PARSER`, and simply define it without a value and make decisions based on the macro being simply defined or not. This patch renames the guard to `JERRY_DISABLE_JS_PARSER` and makes use of it in jerry-core based on its state, not based on its value. As obvious from the guard name, the default for the JS parser is that it is included in the build. The patch also touches those targets in the repository that explicitly defined the original macro (correctly or incorrectly). * Make cppcheck verbose Cppcheck can be quite slow sometimes, especially on Travis CI, which has a "10 mins without output means failure" rule. As the code base of the project grows, we start to undeterministically fall over that limit. Thus, this PR makes cppcheck verbose to ensure that it keeps Travis CI continuously fed with output. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
178 lines
5.2 KiB
Makefile
178 lines
5.2 KiB
Makefile
# Copyright JS Foundation and other contributors, http://js.foundation
|
|
#
|
|
# 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.
|
|
|
|
###########################################################################
|
|
#
|
|
# Copyright 2016 Samsung Electronics All Rights Reserved.
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
############################################################################
|
|
#
|
|
# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions
|
|
# are met:
|
|
#
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in
|
|
# the documentation and/or other materials provided with the
|
|
# distribution.
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
# used to endorse or promote products derived from this software
|
|
# without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
#
|
|
############################################################################
|
|
|
|
-include $(TOPDIR)/.config
|
|
-include $(TOPDIR)/Make.defs
|
|
include $(APPDIR)/Make.defs
|
|
|
|
# Jerryscript built-in application info
|
|
|
|
CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
|
|
CONFIG_JERRYSCRIPT_STACKSIZE ?= 32768
|
|
CONFIG_JERRYSCRIPT_HEAPSIZE ?= 64000
|
|
|
|
APPNAME = jerry
|
|
# path to the project dir, "tizenrt-artik053" by default
|
|
ROOT_DIR = ../../../..
|
|
PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
|
|
STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
|
|
CFLAGS += -std=c99 -DJERRY_NDEBUG '-DCONFIG_MEM_HEAP_AREA_SIZE=$(CONFIG_JERRYSCRIPT_HEAPSIZE)'
|
|
CFLAGS += -I$(ROOT_DIR)/ $(shell find $(ROOT_DIR)/jerryscript/jerry-core -type d | sed -r -e 's/^/-I/g')
|
|
CFLAGS += -I$(ROOT_DIR)/jerryscript/jerry-ext/include
|
|
|
|
ifeq ($(CONFIG_JERRYSCRIPT_MEM_STATS),y)
|
|
CFLAGS += -DJMEM_STATS
|
|
endif
|
|
|
|
ifeq ($(CONFIG_JERRYSCRIPT_SHOW_OPCODES),y)
|
|
CFLAGS += -DPARSER_DUMP_BYTE_CODE
|
|
endif
|
|
|
|
ifeq ($(CONFIG_JERRYSCRIPT_DEBUGGER),y)
|
|
CFLAGS += -DJERRY_DEBUGGER
|
|
endif
|
|
|
|
|
|
EXTRA_LIBS += libjerry-core.a libjerry-libm.a
|
|
LINKLIBS=$(EXTRA_LIBS)
|
|
|
|
|
|
ASRCS = setjmp.S
|
|
CSRCS =
|
|
MAINSRC = jerry_main.c
|
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
|
MAINOBJ = $(MAINSRC:.c=$(OBJEXT))
|
|
|
|
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
|
|
OBJS = $(AOBJS) $(COBJS)
|
|
|
|
ifneq ($(CONFIG_BUILD_KERNEL),y)
|
|
OBJS += $(MAINOBJ)
|
|
endif
|
|
|
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
|
BIN = ..\..\libapps$(LIBEXT)
|
|
else
|
|
ifeq ($(WINTOOL),y)
|
|
BIN = ..\\..\\libapps$(LIBEXT)
|
|
else
|
|
BIN = ../../libapps$(LIBEXT)
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(WINTOOL),y)
|
|
INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}"
|
|
else
|
|
INSTALL_DIR = $(BIN_DIR)
|
|
endif
|
|
|
|
CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)
|
|
PROGNAME = $(CONFIG_JERRYSCRIPT_PROGNAME)
|
|
|
|
ROOTDEPPATH = --dep-path .
|
|
|
|
# Common build
|
|
|
|
VPATH =
|
|
|
|
all: .built
|
|
.PHONY: context depend clean distclean
|
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c
|
|
$(call COMPILE, $<, $@)
|
|
|
|
.built: $(OBJS)
|
|
$(call ARCHIVE, $(BIN), $(OBJS))
|
|
$(Q) touch .built
|
|
|
|
install:
|
|
|
|
context:
|
|
|
|
# Create dependencies
|
|
|
|
.depend: Makefile $(SRCS)
|
|
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
$(Q) touch $@
|
|
|
|
depend: .depend
|
|
|
|
clean:
|
|
$(call DELFILE, .built)
|
|
$(call CLEAN)
|
|
|
|
distclean: clean
|
|
$(call DELFILE, Make.dep)
|
|
$(call DELFILE, .depend)
|
|
|
|
-include Make.dep
|
|
.PHONY: preconfig
|
|
preconfig:
|