]> git.sur5r.net Git - i3/i3/commitdiff
makefile: add COVERAGE flag
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 8 May 2011 17:56:11 +0000 (19:56 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 8 May 2011 17:56:11 +0000 (19:56 +0200)
common.mk

index 86585e5977ca78bbf3d20d534e28050b2566bd89..fed147b88614a6186ad030104fadf5e4bb08c454 100644 (file)
--- 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: