aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Gmeiner2018-04-09 17:11:45 +0200
committerTom Rini2018-04-13 13:02:50 -0400
commit52ff8020d02f312364ceaf0b1114759d3a1f357b (patch)
tree3e48f7c0d3ee125191388959921ba5b3322f2a35 /Makefile
parentcd5d2742521a7af3512cee40d8917e1eb71c0801 (diff)
kconfig: add CONFIG_CC_COVERAGE
Make it possible to use gcc code coverage analysis. v1 -> v2: - Kconfig: remove not needed 'default n' - Makefile: use consistent spacing Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index bfe115cf18d..9eb7e5bf34d 100644
--- a/Makefile
+++ b/Makefile
@@ -725,6 +725,12 @@ else
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
endif
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
+
+ifdef CONFIG_CC_COVERAGE
+KBUILD_CFLAGS += --coverage
+PLATFORM_LIBGCC += -lgcov
+endif
+
export PLATFORM_LIBS
export PLATFORM_LIBGCC