From: Simon Glass Date: Thu, 30 Jun 2016 16:52:20 +0000 (-0600) Subject: tools: Allow building with debug enabled X-Git-Tag: KARO-TXSD-2017-03-15~588 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=022885cb9ce9b22fb62225a21b4eb017a2e8dab5;p=karo-tx-uboot.git tools: Allow building with debug enabled Sometimes it is useful to build tools with debugging information included so that line-number information is available when run under gdb. Add a Kconfig option to support this. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/Kconfig b/Kconfig index 2afbaaf801..ef12f9fbee 100644 --- a/Kconfig +++ b/Kconfig @@ -114,6 +114,15 @@ if EXPERT Warning: When disabling this, please check if malloc calls, maybe should be replaced by calloc - if one expects zeroed memory. + +config TOOLS_DEBUG + bool "Enable debug information for tools" + help + Enable generation of debug information for tools such as mkimage. + This can be used for debugging purposes. With debug information + it is possible to set breakpoints on particular lines, single-step + debug through the source code, etc. + endif endmenu # General setup diff --git a/Makefile b/Makefile index 88128ec72a..7eaa392839 100644 --- a/Makefile +++ b/Makefile @@ -256,7 +256,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ HOSTCC = cc HOSTCXX = c++ -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ + $(if $(CONFIG_TOOLS_DEBUG),-g) HOSTCXXFLAGS = -O2 ifeq ($(HOSTOS),cygwin)