Build gcov code only if MKCOVERAGE is yes

This commit is contained in:
Arun Thomas 2011-08-09 10:39:33 +02:00
parent 4dece73bf0
commit 86b061078b
6 changed files with 23 additions and 3 deletions

View file

@ -13,7 +13,6 @@ SRCS= \
env_parse.c \ env_parse.c \
env_prefix.c \ env_prefix.c \
fkey_ctl.c \ fkey_ctl.c \
gcov.c \
get_randomness.c \ get_randomness.c \
getidle.c \ getidle.c \
getsysinfo.c \ getsysinfo.c \
@ -50,7 +49,6 @@ SRCS= \
sched_start.c \ sched_start.c \
sched_stop.c \ sched_stop.c \
sef.c \ sef.c \
sef_gcov.c \
sef_init.c \ sef_init.c \
sef_liveupdate.c \ sef_liveupdate.c \
sef_ping.c \ sef_ping.c \
@ -128,6 +126,11 @@ SRCS= \
vm_yield_get_block.c \ vm_yield_get_block.c \
vprintf.c \ vprintf.c \
.if ${MKCOVERAGE} != "no"
SRCS+= gcov.c \
sef_gcov.c
CPPFLAGS+= -DUSE_COVERAGE
.endif
CPPFLAGS.sched_start.c+= -I${MINIXSRCDIR} CPPFLAGS.sched_start.c+= -I${MINIXSRCDIR}

View file

@ -24,7 +24,9 @@ FORWARD _PROTOTYPE( void sef_debug_refresh_params, (void) );
PUBLIC _PROTOTYPE( char* sef_debug_header, (void) ); PUBLIC _PROTOTYPE( char* sef_debug_header, (void) );
/* SEF Init prototypes. */ /* SEF Init prototypes. */
#ifdef USE_COVERAGE
EXTERN _PROTOTYPE( int do_sef_gcov_request, (message *m_ptr) ); EXTERN _PROTOTYPE( int do_sef_gcov_request, (message *m_ptr) );
#endif
EXTERN _PROTOTYPE( int do_sef_rs_init, (endpoint_t old_endpoint) ); EXTERN _PROTOTYPE( int do_sef_rs_init, (endpoint_t old_endpoint) );
EXTERN _PROTOTYPE( int do_sef_init_request, (message *m_ptr) ); EXTERN _PROTOTYPE( int do_sef_init_request, (message *m_ptr) );
@ -155,6 +157,7 @@ PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr)
} }
#endif #endif
#ifdef USE_COVERAGE
/* Intercept GCOV data requests (sent by VFS in vfs/gcov.c). */ /* Intercept GCOV data requests (sent by VFS in vfs/gcov.c). */
if(m_ptr->m_type == COMMON_REQ_GCOV_DATA && if(m_ptr->m_type == COMMON_REQ_GCOV_DATA &&
m_ptr->m_source == VFS_PROC_NR) { m_ptr->m_source == VFS_PROC_NR) {
@ -162,6 +165,7 @@ PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr)
continue; continue;
} }
} }
#endif
/* If we get this far, this is not a valid SEF request, return and /* If we get this far, this is not a valid SEF request, return and
* let the caller deal with that. * let the caller deal with that.

View file

@ -11,7 +11,9 @@ SRCS+= fslib.c fsversion.c
SRCS+= dhcp_gettag.c dhcp_settag.c SRCS+= dhcp_gettag.c dhcp_settag.c
# Gcov support. # Gcov support.
.if ${MKCOVERAGE} != "no"
SRCS+= gcov.c gcov_flush.c SRCS+= gcov.c gcov_flush.c
.endif
# Various utils # Various utils
SRCS+= itoa.c u64util.c SRCS+= itoa.c u64util.c

View file

@ -1,10 +1,17 @@
# Makefile for Virtual File System (VFS) # Makefile for Virtual File System (VFS)
.include <bsd.own.mk>
PROG= vfs PROG= vfs
SRCS= main.c open.c read.c write.c pipe.c dmap.c \ SRCS= main.c open.c read.c write.c pipe.c dmap.c \
path.c device.c mount.c link.c exec.c \ path.c device.c mount.c link.c exec.c \
filedes.c stadir.c protect.c time.c \ filedes.c stadir.c protect.c time.c \
lock.c misc.c utility.c select.c table.c \ lock.c misc.c utility.c select.c table.c \
vnode.c vmnt.c request.c fscall.c gcov.c vnode.c vmnt.c request.c fscall.c
.if ${MKCOVERAGE} != "no"
SRCS+= gcov.c
CPPFLAGS+= -DUSE_COVERAGE
.endif
DPADD+= ${LIBSYS} ${LIBTIMERS} ${LIBEXEC} DPADD+= ${LIBSYS} ${LIBTIMERS} ${LIBEXEC}
LDADD+= -lsys -ltimers -lexec LDADD+= -lsys -ltimers -lexec

View file

@ -282,6 +282,9 @@ _PROTOTYPE( int do_write, (void) );
/* gcov.c */ /* gcov.c */
_PROTOTYPE( int do_gcov_flush, (void) ); _PROTOTYPE( int do_gcov_flush, (void) );
#if ! USE_COVERAGE
#define do_gcov_flush no_sys
#endif
/* select.c */ /* select.c */
_PROTOTYPE( int do_select, (void) ); _PROTOTYPE( int do_select, (void) );

View file

@ -821,6 +821,7 @@ MKWATCHDOG:= no
MKACPI:= no MKACPI:= no
MKAPIC:= no MKAPIC:= no
MKMCONTEXT:= no MKMCONTEXT:= no
MKCOVERAGE:= no
.endif .endif
# #