From 44b8d752a133df7abfa5b17dde78e3f5c5450022 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 10 Nov 2020 12:46:14 -0500 Subject: Makefile: New gcov target --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4e67cf6..70a78ef 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,10 @@ ifdef SANITIZE LOCAL_CFLAGS += -fno-sanitize-recover=all endif +ifneq ($(filter gcov,$(MAKECMDGOALS)),) +LOCAL_CFLAGS += --coverage +endif + ifneq ($(filter release,$(MAKECMDGOALS)),) CFLAGS := -g $(WFLAGS) -O3 -flto -DNDEBUG endif @@ -130,6 +134,8 @@ ubsan: bfs @: msan: bfs @: +gcov: bfs + @: release: bfs @: @@ -166,7 +172,7 @@ endif +$(MAKE) -B check $(DISTCHECK_FLAGS) clean: - $(RM) bfs *.[od] tests/mksock tests/trie tests/xtimegm tests/*.[od] + $(RM) bfs *.[od] *.gcda *.gcno tests/mksock tests/trie tests/xtimegm tests/*.[od] tests/*.gcda tests/*.gcno install: $(MKDIR) $(DESTDIR)$(PREFIX)/bin -- cgit v1.2.3