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: