From 2c17515f3c53c4ec5846b1621a373ba7b5628f74 Mon Sep 17 00:00:00 2001
From: Matt Jordan <mjordan@digium.com>
Date: Sat, 27 Jun 2015 18:47:19 -0500
Subject: [PATCH] Makefile: Remove coverage files on 'make clean'

This patch updates a variety of Makefiles in Asterisk's build system to
remove .gcda and .gcno files when 'make clean' is executed. These files
are generated when '--enable-coverage' is passed to the Asterisk
configure script.

Change-Id: Ib70b41eea2ee2908885bff02e80faf9f40c84602
---
 Makefile.moddir_rules   | 5 +++--
 channels/Makefile       | 1 -
 channels/misdn/Makefile | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index e7022822d8..df715d9875 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -81,8 +81,8 @@ clean-$(1)$(3):
 
 endef
 
-MOD_ADD_C=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.c,.i,.o))
-MOD_ADD_CC=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.cc,.ii,.oo))
+MOD_ADD_C=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.c,.i,.o,.gcda,.gcno))
+MOD_ADD_CC=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.cc,.ii,.oo,.gcda,.gcno))
 
 $(addsuffix .oo,$(CC_MODS)) $(addsuffix .o,$(C_MODS)):	\
 	_ASTCFLAGS+=$(call MOD_ASTCFLAGS,$*)
@@ -140,6 +140,7 @@ clean::
 	rm -f *.so *.o *.oo *.eo *.i *.ii
 	rm -f .*.d
 	rm -f *.s *.i
+	rm -f *.gcda *.gcno
 	rm -f modules.link
 
 install:: all
diff --git a/channels/Makefile b/channels/Makefile
index 733ce4111c..44a0429a93 100644
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -23,7 +23,6 @@ ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
   LIBS+= -lres_monitor.so
 endif
 
-
 $(call MOD_ADD_C,chan_iax2,$(wildcard iax2/*.c))
 $(call MOD_ADD_C,chan_sip,$(wildcard sip/*.c))
 $(call MOD_ADD_C,chan_pjsip,$(wildcard pjsip/*.c))
diff --git a/channels/misdn/Makefile b/channels/misdn/Makefile
index 194bef5aea..96d5a2a3d2 100644
--- a/channels/misdn/Makefile
+++ b/channels/misdn/Makefile
@@ -14,4 +14,4 @@ portinfo: portinfo.o
 	$(CC) -o $@ $^ -lisdnnet -lmISDN -lpthread
 
 clean:
-	rm -rf *.a *.o *.so portinfo *.i
+	rm -rf *.a *.o *.so portinfo *.i *.gcda *.gcno
-- 
GitLab