From: Howard Chu Date: Mon, 30 Jun 2014 11:42:41 +0000 (-0700) Subject: More gcov setup tweaks X-Git-Tag: OPENLDAP_REL_ENG_2_4_40~127^2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ee599c525052948b623e8980db67c7032feedb4e;p=openldap More gcov setup tweaks --- diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile index bb0b1e8c72..60ab528f65 100644 --- a/libraries/liblmdb/Makefile +++ b/libraries/liblmdb/Makefile @@ -77,17 +77,21 @@ midl.o: midl.c midl.h %.o: %.c lmdb.h $(CC) $(CFLAGS) $(CPPFLAGS) -c $< +COV_FLAGS=-fprofile-arcs -ftest-coverage +COV_OBJS=xmdb.o xmidl.o + coverage: xmtest - -rm -rf testdb; mkdir testdb - ./xmtest + for i in mtest*.c [0-9]*.c; do j=`basename \$$i .c`; $(MAKE) $$j.o; \ + gcc -o x$$j $$j.o $(COV_OBJS) -pthread $(COV_FLAGS); \ + rm -rf testdb; mkdir testdb; ./x$$j; done gcov xmdb.c gcov xmidl.c xmtest: mtest.o xmdb.o xmidl.o - gcc -o xmtest mtest.o xmdb.o xmidl.o -pthread -fprofile-arcs -ftest-coverage + gcc -o xmtest mtest.o xmdb.o xmidl.o -pthread $(COV_FLAGS) xmdb.o: mdb.c lmdb.h midl.h - $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 -fprofile-arcs -ftest-coverage -c mdb.c -o $@ + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 $(COV_FLAGS) -c mdb.c -o $@ xmidl.o: midl.c midl.h - $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 -fprofile-arcs -ftest-coverage -c midl.c -o $@ + $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 $(COV_FLAGS) -c midl.c -o $@