This adds the -fprofile-arcs and -ftest-coverage options when compiling
the source code for the static library. Those same options must then be
used when linking the static library into an executable. This updates
Makefile.in to remove and .gitignore to ignore the files generated when
testing coverage.
*.o
*.dylib
+*.gcda
+*.gcno
+*.gcov
+
/example
/example64
/examplesh
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
rm -rf objs
+ rm -f *.gcda *.gcno *.gcov
maintainer-clean: distclean
distclean: clean zconf zconf.h.cmakein docs
shared_ext='.so'
shared=1
solo=0
+cover=0
zprefix=0
build64=0
gcc=0
-s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static) shared=0; shift ;;
--solo) solo=1; shift ;;
+ --cover) cover=1; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
PIC_OBJC='$(PIC_OBJZ)'
fi
+if test $cover -eq 1; then
+ CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
+fi
+
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
fi ;;
esac
-rm -f $test.[co] $test $test$shared_ext
+rm -f $test.[co] $test $test$shared_ext $test.gcno
# udpate Makefile
sed < Makefile.in "