From owner-svn-src-projects@freebsd.org  Thu Aug 17 20:10:32 2017
Return-Path: <owner-svn-src-projects@freebsd.org>
Delivered-To: svn-src-projects@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EC42DD3ECC
 for <svn-src-projects@mailman.ysv.freebsd.org>;
 Thu, 17 Aug 2017 20:10:32 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CDA213278;
 Thu, 17 Aug 2017 20:10:31 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7HKAUhR014799;
 Thu, 17 Aug 2017 20:10:30 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7HKAUDC014798;
 Thu, 17 Aug 2017 20:10:30 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201708172010.v7HKAUDC014798@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Ngie Cooper <ngie@FreeBSD.org>
Date: Thu, 17 Aug 2017 20:10:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r322632 - projects/runtime-coverage/share/mk
X-SVN-Group: projects
X-SVN-Commit-Author: ngie
X-SVN-Commit-Paths: projects/runtime-coverage/share/mk
X-SVN-Commit-Revision: 322632
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects/>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 17 Aug 2017 20:10:32 -0000

Author: ngie
Date: Thu Aug 17 20:10:30 2017
New Revision: 322632
URL: https://svnweb.freebsd.org/changeset/base/322632

Log:
  - Only pass --coverage if NO_SHARED != yes (it doesn't work with static
    libraries).
  - Fix typo (${PROGNAME}.full should be ${PROG_FULL} -- this fixes installing
    usr.sbin/xinstall).
  - Pass through appropriate sentinel for determining whether or not the program
    should be compiled with debug symbols, and hence whether or not --coverage
    should be enabled.

Modified:
  projects/runtime-coverage/share/mk/bsd.prog.mk

Modified: projects/runtime-coverage/share/mk/bsd.prog.mk
==============================================================================
--- projects/runtime-coverage/share/mk/bsd.prog.mk	Thu Aug 17 20:07:12 2017	(r322631)
+++ projects/runtime-coverage/share/mk/bsd.prog.mk	Thu Aug 17 20:10:30 2017	(r322632)
@@ -37,17 +37,13 @@ MK_DEBUG_FILES=	no
 .if defined(CRUNCH_CFLAGS)
 CFLAGS+=${CRUNCH_CFLAGS}
 .else
-.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
-    empty(DEBUG_FLAGS:M-gdwarf-*)
+.if ${MK_DEBUG_FILES} != "no"
+.if empty(DEBUG_FLAGS:M-g) && empty(DEBUG_FLAGS:M-gdwarf-*)
 CFLAGS+= -g
 CXXFLAGS+= -g
 CTFFLAGS+= -g
 .endif
-.if ${MK_COVERAGE} != "no" && \
-    (${CFLAGS:M-g*} != "" || ${CXXFLAGS:M-g*})
-_COV_FLAG= --coverage
-CFLAGS+= ${_COV_FLAG}
-CXXFLAGS+= ${_COV_FLAG}
+_WANTS_DEBUG=
 .endif
 .endif
 
@@ -64,7 +60,13 @@ TAG_ARGS=	-T ${TAGS:[*]:S/ /,/g}
 
 .if defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
 LDFLAGS+= -static
+.else
+.if defined(_WANTS_DEBUG) && ${MK_COVERAGE} != "no"
+_COV_FLAG= --coverage
+CFLAGS+= ${_COV_FLAG}
+CXXFLAGS+= ${_COV_FLAG}
 .endif
+.endif
 
 .if ${MK_DEBUG_FILES} != "no"
 PROG_FULL=${PROG}.full
@@ -251,7 +253,7 @@ _proginstall:
 	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -d ${DESTDIR}${COVERAGEDIR}/
 .endif
 	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \
-	    ${PROGNAME}.full ${DESTDIR}${COVERAGEDIR}/${PROGNAME}
+	    ${PROG_FULL} ${DESTDIR}${COVERAGEDIR}/${PROGNAME}
 .endif
 .if defined(DEBUGMKDIR)
 	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/