mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +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 | \
|
CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \
|
||||||
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//')
|
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//')
|
||||||
ifeq ($(CORE_DUMPER),)
|
ifeq ($(CORE_DUMPER),)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,19 @@
|
||||||
# ----- compilation options
|
# ----- compilation options
|
||||||
#COMPILER_SUITE ?= clang
|
#COMPILER_SUITE ?= clang
|
||||||
COMPILER_SUITE ?= gcc
|
COMPILER_SUITE ?= gcc
|
||||||
|
CPP_STANDARD_VERSION ?= 17
|
||||||
|
C_STANDARD_VERSION ?= 11
|
||||||
LIBTYPE ?= shared
|
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))
|
ifeq ($(TARGET_ARCH),$(ARCH_32))
|
||||||
PROJECT_CFLAGS += -m32
|
PROJECT_CFLAGS += -m32
|
||||||
PROJECT_CPPFLAGS += -m32
|
PROJECT_CPPFLAGS += -m32
|
||||||
|
|
@ -155,13 +166,8 @@ ifeq ($(COMPILER_SUITE),gcc)
|
||||||
CPP = $(GPP)
|
CPP = $(GPP)
|
||||||
LD = $(GPP)
|
LD = $(GPP)
|
||||||
|
|
||||||
ifneq ($(GCC_VERSION),4.1.0)
|
BUILD_CPPFLAGS += -std=c++$(CPP_STANDARD_VERSION)
|
||||||
ifneq ($(GCC_VERSION),4.5.1)
|
BUILD_CFLAGS += -std=gnu$(C_STANDARD_VERSION)
|
||||||
BUILD_CFLAGS += -std=gnu11
|
|
||||||
BUILD_CPPFLAGS += -std=c++11
|
|
||||||
#BUILD_CPPFLAGS += -Wsuggest-override
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(shell $(TEST) $(GCC_MAJOR) -ge 5; $(ECHO) $$?),0)
|
ifeq ($(shell $(TEST) $(GCC_MAJOR) -ge 5; $(ECHO) $$?),0)
|
||||||
ifeq ($(USE_CPP_FORCE_OVERRIDE),true)
|
ifeq ($(USE_CPP_FORCE_OVERRIDE),true)
|
||||||
|
|
@ -403,9 +409,10 @@ ifeq ($(USE_STACK_CHECK),true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||||
BUILD_CFLAGS += -gdwarf-2 -g3 -ggdb
|
#BUILD_EXTRA_DEBUG_FLAGS += -gdwarf-2
|
||||||
BUILD_CPPFLAGS += -gdwarf-2 -g3 -ggdb
|
BUILD_CFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||||
BUILD_LDFLAGS += -gdwarf-2 -g3 -ggdb
|
BUILD_CPPFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||||
|
BUILD_LDFLAGS += -g3 $(BUILD_EXTRA_DEBUG_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CC),$(GCC))
|
ifeq ($(CC),$(GCC))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue