Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jul 2014 00:54:35 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268541 - head/share/mk
Message-ID:  <201407120054.s6C0sZcn074678@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407120054.s6C0sZcn074678>