3 # gcov capability for udev
5 # Provides code coverage analysis for udev.
7 # make_gcov.sh assumes the same same default parameters as make, but also
8 # accepts the same parameters as make (see README file in udev/ for
9 # parameter info). There is one exception, klibc can not be used with
10 # gcov as it will not compile cleanly.
12 # make_gcov.sh then overrides CFLAGS to strip out optimization in order
13 # for gcov to get correct code coverage analysis.
15 # Leann Ogasawara <ogasawara@osdl.org>, April 2004
19 find -name "*.da" -exec rm -f "{}" \;
20 find -name "*.bb" -exec rm -f "{}" \;
21 find -name "*.bbg" -exec rm -f "{}" \;
22 find -name "*.gcov" -exec rm -f "{}" \;
27 GCCINCDIR=`gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"`
28 LIBSYSFS="-I$PWD/libsysfs"
29 WARNINGS="-Wall -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
33 GCOV_FLAGS="-pipe -fprofile-arcs -ftest-coverage"
36 pre=`echo $i | sed 's/=.*//g'`
37 post=`echo $i | sed 's/.*=//g'`
38 if [ $pre = "USE_KLIBC" ] && [ $post = "true" ]; then
39 echo "cannot use gcov with klibc, will not compile"
41 elif [ $pre = "USE_LOG" ] && [ $post = "false" ]; then
43 elif [ $pre = "DEBUG" ] && [ $post = "true" ]; then
44 DEBUG="-g -DDEBUG -D_GNU_SOURCE"
45 elif [ $pre = "clean" ]; then
53 make $* CFLAGS="$WARNINGS $GCOV_FLAGS $USE_LOG $DEBUG $GCC $LIBSYSFS"