Add bsd.cov.mk

It's a Makefile snippet that currently handles cleanup/installation of
.gcno files
This commit is contained in:
Enji Cooper 2017-07-31 08:02:25 +00:00
parent 8bd0ba0ac0
commit dc5068b507
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/runtime-coverage/; revision=321765
2 changed files with 25 additions and 0 deletions

View File

@ -69,6 +69,10 @@ FILES= \
FILESDIR= ${BINDIR}/mk
.if ${MK_COVERAGE} != "no"
FILES+= bsd.cov.mk
.endif
.if ${MK_TESTS} != "no"
FILES+= atf.test.mk
FILES+= plain.test.mk

21
share/mk/bsd.cov.mk Normal file
View File

@ -0,0 +1,21 @@
# $FreeBSD$
.include <bsd.own.mk>
FILESGROUPS?= FILES
FILESGROUPS+= GCNOS
_GCNO_FILES= ${OBJS:.o=.gcno}
CLEANFILES+= ${_GCNO_FILES}
GCNOS+= ${_GCNO_FILES}
.for _gcno_file in ${_GCNO_FILES}
_gcno_dir= ${COVERAGEDIR}${_gcno_file:tA:H}
_gcno_fulldir= ${DESTDIR}${_gcno_dir}
GCNOSDIR_${_gcno_file:T}= ${_gcno_dir}
.if !target(${_gcno_fulldir})
beforeinstall: ${_gcno_fulldir}
${_gcno_fulldir}:
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -d ${.TARGET}
.endif
.endfor