From 78264958c0451dd7e28743efed36733743ae761e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 8 May 2011 19:56:11 +0200 Subject: [PATCH] makefile: add COVERAGE flag --- common.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common.mk b/common.mk index 86585e59..fed147b8 100644 --- a/common.mk +++ b/common.mk @@ -1,5 +1,6 @@ UNAME=$(shell uname) DEBUG=1 +COVERAGE=0 INSTALL=install PREFIX=/usr ifeq ($(PREFIX),/usr) @@ -97,6 +98,11 @@ CFLAGS += -O2 CFLAGS += -freorder-blocks-and-partition endif +ifeq ($(COVERAGE),1) +CFLAGS += -fprofile-arcs -ftest-coverage +LDFLAGS += -lgcov +endif + # Don’t print command lines which are run .SILENT: