mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
debugger.mk, defs-cpp.mk: More consistent compiler flags
Implement more consistent handling of flags -std=xx, -gdb, -gdwarf-x. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
68f25261ba
commit
2a9cdc5540
2 changed files with 18 additions and 20 deletions
|
|
@ -1,12 +1,3 @@
|
|||
ifeq "$(COMPILER_SUITE)" "gcc"
|
||||
DEBUGGER = gdb
|
||||
endif
|
||||
|
||||
ifeq "$(COMPILER_SUITE)" "clang"
|
||||
DEBUGGER = lldb
|
||||
endif
|
||||
|
||||
|
||||
CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \
|
||||
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//')
|
||||
ifeq ($(CORE_DUMPER),)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,19 @@
|
|||
# ----- compilation options
|
||||
#COMPILER_SUITE ?= clang
|
||||
COMPILER_SUITE ?= gcc
|
||||
CPP_STANDARD_VERSION ?= 17
|
||||
C_STANDARD_VERSION ?= 11
|
||||
LIBTYPE ?= shared
|
||||
|
||||
ifeq ($(COMPILER_SUITE),gcc)
|
||||
DEBUGGER ?= gdb
|
||||
BUILD_EXTRA_DEBUG_FLAGS += -ggdb
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER_SUITE),clang)
|
||||
DEBUGGER = lldb
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),$(ARCH_32))
|
||||
PROJECT_CFLAGS += -m32
|
||||
PROJECT_CPPFLAGS += -m32
|
||||
|
|
@ -155,13 +166,8 @@ ifeq ($(COMPILER_SUITE),gcc)
|
|||
CPP = $(GPP)
|
||||
LD = $(GPP)
|
||||
|
||||
ifneq ($(GCC_VERSION),4.1.0)
|
||||
ifneq ($(GCC_VERSION),4.5.1)
|
||||
BUILD_CFLAGS += -std=gnu11
|
||||
BUILD_CPPFLAGS += -std=c++11
|
||||
#BUILD_CPPFLAGS += -Wsuggest-override
|
||||
endif
|
||||
endif
|
||||
BUILD_CPPFLAGS += -std=c++$(CPP_STANDARD_VERSION)
|
||||
BUILD_CFLAGS += -std=gnu$(C_STANDARD_VERSION)
|
||||
|
||||
ifeq ($(shell $(TEST) $(GCC_MAJOR) -ge 5; $(ECHO) $$?),0)
|
||||
ifeq ($(USE_CPP_FORCE_OVERRIDE),true)
|
||||
|
|
@ -283,7 +289,7 @@ ifeq ($(USE_GFILTER),true)
|
|||
endif
|
||||
|
||||
ifeq ($(USE_PROJECT_LIB),true)
|
||||
PROJECTLIB_LDFLAGS += -L$(TOPDIR)/lib -l$(LIBNAME)
|
||||
PROJECTLIB_LDFLAGS += -L$(TOPDIR)/lib -l$(LIBNAME)
|
||||
endif
|
||||
|
||||
ifneq ($(filter jw-build,$(PREREQ_BUILD)),)
|
||||
|
|
@ -403,9 +409,10 @@ ifeq ($(USE_STACK_CHECK),true)
|
|||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||
BUILD_CFLAGS += -gdwarf-2 -g3 -ggdb
|
||||
BUILD_CPPFLAGS += -gdwarf-2 -g3 -ggdb
|
||||
BUILD_LDFLAGS += -gdwarf-2 -g3 -ggdb
|
||||
#BUILD_EXTRA_DEBUG_FLAGS += -gdwarf-2
|
||||
BUILD_CFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||
BUILD_CPPFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||
BUILD_LDFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(CC),$(GCC))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue