aboutsummaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-06-11 11:14:41 -0700
committerTom Rini <trini@ti.com>2013-06-26 10:16:41 -0400
commit5c2aeac5ae3556fd75e63596740d9ce0faf7afa4 (patch)
tree5e0b9a8affe35e9bb5dde69fec9bb93b5071ff25 /config.mk
parentcabcbb56c86f77d8b5cc57ae86d5fa6dc718f4f7 (diff)
downloadu-boot-5c2aeac5ae3556fd75e63596740d9ce0faf7afa4.zip
u-boot-5c2aeac5ae3556fd75e63596740d9ce0faf7afa4.tar.gz
u-boot-5c2aeac5ae3556fd75e63596740d9ce0faf7afa4.tar.bz2
Support tracing in config.mk when enabled
Use -finstrument-functions when tracing is enabled (make FTRACE=1). Tracing is not currently supported by SPL even if sufficient memory is available. When tracing is enabled, we #define FTRACE. This can be used by board config files to conditionally enable the tracing options. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index ddf350e..63d25ac 100644
--- a/config.mk
+++ b/config.mk
@@ -268,6 +268,16 @@ CFLAGS += $(CFLAGS_WARN)
CFLAGS_STACK := $(call cc-option,-fstack-usage)
CFLAGS += $(CFLAGS_STACK)
+BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
+
+ifeq ($(findstring examples/,$(BCURDIR)),)
+ifeq ($(CONFIG_SPL_BUILD),)
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+endif
+endif
+
# $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
# option to the assembler.
AFLAGS_DEBUG :=
@@ -330,7 +340,6 @@ export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS
#########################################################################
# Allow boards to use custom optimize flags on a per dir/file basis
-BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))