From 0ad0a39a40e63ab3293114c08ba477d0a66dc398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Fri, 6 Oct 2017 13:51:47 +0200 Subject: [PATCH] makefiles: Split GDB settings from toolchain --- makefiles/toolchain/gnu.inc.mk | 4 ++-- makefiles/toolchain/llvm.inc.mk | 4 ++-- makefiles/tools/gdb.inc.mk | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 makefiles/tools/gdb.inc.mk diff --git a/makefiles/toolchain/gnu.inc.mk b/makefiles/toolchain/gnu.inc.mk index bcd22773401f..3f597a8ee073 100644 --- a/makefiles/toolchain/gnu.inc.mk +++ b/makefiles/toolchain/gnu.inc.mk @@ -1,4 +1,3 @@ -export GDBPREFIX ?= $(PREFIX) export CC = $(PREFIX)gcc export CXX = $(PREFIX)g++ export CCAS ?= $(CC) @@ -16,4 +15,5 @@ $(warning objcopy not found. Hex file will not be created.) export OBJCOPY = true endif export OBJDUMP = $(PREFIX)objdump -export GDB = $(GDBPREFIX)gdb +# We use GDB for debugging +include $(RIOTMAKE)/tools/gdb.inc.mk diff --git a/makefiles/toolchain/llvm.inc.mk b/makefiles/toolchain/llvm.inc.mk index c0aa4825b308..ffc38ed0e803 100644 --- a/makefiles/toolchain/llvm.inc.mk +++ b/makefiles/toolchain/llvm.inc.mk @@ -1,4 +1,3 @@ -export GDBPREFIX ?= $(PREFIX) export LLVMPREFIX ?= llvm- # Apple XCode doesn't prefix its tools with llvm-, but manually installed LLVM # on OSX might have the llvm- prefix, we can't simply test against uname -s. @@ -25,9 +24,10 @@ export OBJCOPY = true endif export OBJDUMP = $(LLVMPREFIX)objdump export SIZE = $(LLVMPREFIX)size -export GDB = $(GDBPREFIX)gdb # LLVM lacks a binutils strip tool as well... #export STRIP = $(LLVMPREFIX)strip +# We use GDB for debugging for now, maybe LLDB will be supported in the future. +include $(RIOTMAKE)/tools/gdb.inc.mk ifneq (,$(TARGET_ARCH)) # Clang on Linux uses GCC's C++ headers and libstdc++ (installed with GCC) diff --git a/makefiles/tools/gdb.inc.mk b/makefiles/tools/gdb.inc.mk new file mode 100644 index 000000000000..143f11d13226 --- /dev/null +++ b/makefiles/tools/gdb.inc.mk @@ -0,0 +1,2 @@ +export GDBPREFIX ?= $(PREFIX) +export GDB ?= $(GDBPREFIX)gdb