From owner-svn-src-all@FreeBSD.ORG Sat Jul 12 00:54:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DA56B7A; Sat, 12 Jul 2014 00:54:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6A4162A46; Sat, 12 Jul 2014 00:54:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6C0sZKX074679; Sat, 12 Jul 2014 00:54:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C0sZcn074678; Sat, 12 Jul 2014 00:54:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201407120054.s6C0sZcn074678@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Jul 2014 00:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268541 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 00:54:35 -0000 Author: rpaulo Date: Sat Jul 12 00:54:34 2014 New Revision: 268541 URL: http://svnweb.freebsd.org/changeset/base/268541 Log: Automatically build and link DTrace USDT probes. This completely replaces bsd.dtrace.mk which never worked reliably. MFC after: 3 weeks Deleted: head/share/mk/bsd.dtrace.mk Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Jul 11 23:41:56 2014 (r268540) +++ head/share/mk/bsd.dep.mk Sat Jul 12 00:54:34 2014 (r268541) @@ -121,12 +121,26 @@ ${_YC:R}.o: ${_YC} .endfor # DTrace probe definitions +# libelf is currently needed for drti.o +.if ${SRCS:M*.d} +LDFLAGS+= -lelf +LDADD+= ${LIBELF} +CFLAGS+= -D_DTRACE_VERSION=1 +.endif .for _DSRC in ${SRCS:M*.d:N*/*} -.for _DH in ${_DSRC:R}.h -${_DH}: ${_DSRC} - ${DTRACE} -xnolibs -h -s ${.ALLSRC} -SRCS:= ${SRCS:S/${_DSRC}/${_DH}/} -CLEANFILES+= ${_DH} +.for _D in ${_DSRC:R} +${_D}.h: ${_DSRC} + ${DTRACE} -xnolibs -h -s ${.ALLSRC} +SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/} +${_D}.o: ${_D}.h ${_DSRC} ${OBJS} ${SOBJS} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${_DSRC} \ + ${OBJS:S/${_D}.o//} ${SOBJS:S/${_D}.o//} +CLEANFILES+= ${_D}.h ${_D}.o +.if defined(PROG) +OBJS+= ${_D:R}.o +.else +SOBJS+= ${_D:R}.o +.endif .endfor .endfor .endif