]> git.mdlowis.com Git - projs/tide.git/commitdiff
Added support for gcov to makefile
authorMike Lowis <mike.lowis@gentex.com>
Tue, 25 Oct 2016 20:24:02 +0000 (16:24 -0400)
committerMike Lowis <mike.lowis@gentex.com>
Tue, 25 Oct 2016 20:24:02 +0000 (16:24 -0400)
Makefile

index fdceb9c1c1767da527c795413f31a2a7e7ab4aa0..0c79a352da9ddc7327aec0e50ee5c222611ab3b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
-LDFLAGS  = -L/opt/X11/lib -lX11 -lXft -lfontconfig
-CFLAGS   = -Os --std=gnu99 -Wall -Wextra -I. -I/opt/X11/include -I/opt/local/include/freetype2 -I/usr/include/freetype2
+#GCOV     = --coverage
+LDFLAGS  = $(GCOV) -L/opt/X11/lib -lX11 -lXft -lfontconfig
+CFLAGS   = $(GCOV) -Os --std=gnu99 -Wall -Wextra -I. -I/opt/X11/include -I/opt/local/include/freetype2 -I/usr/include/freetype2
 OBJS     = buf.o screen.o utf8.o keyboard.o mouse.o charset.o utils.o
 TESTOBJS = tests/tests.o tests/buf.o tests/utf8.o
 
@@ -14,8 +15,13 @@ edit: xedit.o $(OBJS)
 unittests: $(TESTOBJS) $(OBJS)
        $(CC) -o $@ $^ $(LDFLAGS)
 
+coverage: test
+       gcov -fabc $(OBJS) > coverage.txt
+
+
 clean:
-       $(RM) edit unittests xedit.o $(OBJS) $(TESTOBJS)
+       $(RM) edit unittests xedit.o $(OBJS) $(TESTOBJS) coverage.txt
+       $(RM) *.gcno *.gcda *.gcov tests/*.gcno tests/*.gcda tests/*.gcov
 
 $(OBJS): edit.h Makefile
 xedit.o: edit.h Makefile