Use -gdwarf-3 by default, -gdwarf-4 if dwarf4=1 option is passed to make.

This commit is contained in:
Ruben Ayrapetyan 2014-07-25 13:51:35 +04:00
parent 1d42426fa4
commit 361e5a6f38
2 changed files with 19 additions and 0 deletions

View File

@ -33,6 +33,10 @@
#
# Unit test target: unittests
#
# Options
#
# dwarf4=1 - use DWARF v4 format for debug information
#
export TARGET_MODES = debug debug_release release
export TARGET_PC_SYSTEMS = linux
@ -48,6 +52,8 @@ export FLASH_TARGETS = $(foreach __TARGET,$(foreach __MODE,$(TARGET_MODES),$(for
export OUT_DIR = ./out
export UNITTESTS_SRC_DIR = ./tests/unit
export dwarf4
all: clean $(JERRY_TARGETS) $(TESTS_TARGET) $(CHECK_TARGETS)
$(JERRY_TARGETS) $(TESTS_TARGET) $(FLASH_TARGETS) $(CHECK_TARGETS):

View File

@ -41,6 +41,13 @@ endif
# Options setup
#
# DWARF version
ifeq ($(dwarf4),1)
OPTION_DWARF4 := enable
else
OPTION_DWARF4 := disable
endif
# JERRY_NDEBUG, debug symbols
ifeq ($(TARGET_MODE),release)
OPTION_NDEBUG = enable
@ -94,6 +101,12 @@ LDFLAGS_NO_OPTIMIZE ?=
# Debug symbols
CFLAGS_DEBUG_SYMS ?= -g3
ifeq ($(OPTION_DWARF4),enable)
CFLAGS_DEBUG_SYMS += -gdwarf-4
else
CFLAGS_DEBUG_SYMS += -gdwarf-3
endif
# Cortex-M4 MCU
CFLAGS_CORTEXM4 ?= -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb \
-mfpu=fpv4-sp-d16 -mfloat-abi=hard