From: Mike Lowis Date: Tue, 25 Oct 2016 20:24:02 +0000 (-0400) Subject: Added support for gcov to makefile X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6f2460f66f3226c707d5c16cf7a662a0dc7489dd;p=projs%2Ftide.git Added support for gcov to makefile --- diff --git a/Makefile b/Makefile index fdceb9c..0c79a35 100644 --- 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