[EMAIL PROTECTED] (Ludovic Courtès) writes:
>> Hi Ludovic. Thanks, I pushed this patch. Adding anything to LDFLAGS
>> doesn't seem to be required though?
>
> According to the doc (info "(gcc)Debugging Options") it is required.
> See also this example (with GCC 4.2.4):
>
> $ cat > t.c <<EOF
> int main (int argc, char *argv[]) { return 0; }
> EOF
> $ gcc --coverage -c t.c
> $ gcc t.o
> t.o: In function `global constructors keyed to 0_main':
> t.c:(.text+0x43): undefined reference to `__gcov_init'
> t.o:(.data+0x24): undefined reference to `__gcov_merge_add'
> collect2: ld returned 1 exit status
> $ gcc --coverage t.o
> [ success ]
Yes, but it seems that --coverage is passed to the command line to link
applications with CFLAGS:
[EMAIL PROTECTED]:~/src/libidn/src master$ rm idn
[EMAIL PROTECTED]:~/src/libidn/src master$ make CFLAGS="-g --coverage"
make all-am
make[1]: Entering directory `/home/jas/src/libidn/src'
/bin/bash ../libtool --tag=CC --mode=link gcc -std=gnu99 -Wall -Werror -g
--coverage -o idn idn.o idn_cmd.o ../lib/libidn.la ../gl/libgnu.la
libtool: link: gcc -std=gnu99 -Wall -Werror -g --coverage -o .libs/idn idn.o
idn_cmd.o ../lib/.libs/libidn.so ../gl/.libs/libgnu.a
make[1]: Leaving directory `/home/jas/src/libidn/src'
[EMAIL PROTECTED]:~/src/libidn/src master$
At least the rules in maint.mk seems to work for me in several projects.
All of them uses libtool though.
/Simon