Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2014 16:11:57 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r269946 - stable/10/share/mk
Message-ID:  <201408131611.s7DGBv0P007591@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Wed Aug 13 16:11:57 2014
New Revision: 269946
URL: http://svnweb.freebsd.org/changeset/base/269946

Log:
  MFC  r268300 r268541 r268544 r268565 r269775 r269838 r269839 r269840
       r269842 r269844 r269899:
  
  BSD make support for generating and compiling USDT DTrace probes.

Deleted:
  stable/10/share/mk/bsd.dtrace.mk
Modified:
  stable/10/share/mk/Makefile
  stable/10/share/mk/bsd.dep.mk
  stable/10/share/mk/bsd.lib.mk
  stable/10/share/mk/bsd.prog.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/Makefile
==============================================================================
--- stable/10/share/mk/Makefile	Wed Aug 13 15:50:16 2014	(r269945)
+++ stable/10/share/mk/Makefile	Wed Aug 13 16:11:57 2014	(r269946)
@@ -11,7 +11,6 @@ FILES=	\
 	bsd.crunchgen.mk \
 	bsd.dep.mk \
 	bsd.doc.mk \
-	bsd.dtrace.mk \
 	bsd.endian.mk \
 	bsd.files.mk \
 	bsd.incs.mk \

Modified: stable/10/share/mk/bsd.dep.mk
==============================================================================
--- stable/10/share/mk/bsd.dep.mk	Wed Aug 13 15:50:16 2014	(r269945)
+++ stable/10/share/mk/bsd.dep.mk	Wed Aug 13 16:11:57 2014	(r269946)
@@ -73,7 +73,7 @@ tags: ${SRCS}
 CLEANFILES?=
 
 .if !exists(${.OBJDIR}/${DEPENDFILE})
-.for _S in ${SRCS:N*.[hly]}
+.for _S in ${SRCS:N*.[dhly]}
 ${_S:R}.o: ${_S}
 .endfor
 .endif
@@ -121,14 +121,36 @@ ${_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 -I${.OBJDIR}
+.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}
+DHDRS+=	${_D}.h
+${_D}.h: ${_DSRC}
+	${DTRACE} -xnolibs -h -s ${.ALLSRC}
+SRCS:=	${SRCS:S/${_DSRC}/${_D}.h/}
+OBJS+=	${_D}.o
+CLEANFILES+= ${_D}.h ${_D}.o
+${_D}.o: ${_D}.h ${OBJS:S/${_D}.o//}
+	${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \
+		${OBJS:S/${_D}.o//}
+.if defined(LIB)
+CLEANFILES+= ${_D}.So ${_D}.po
+${_D}.So: ${_D}.h ${SOBJS:S/${_D}.So//}
+	${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \
+		${SOBJS:S/${_D}.So//}
+${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//}
+	${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \
+		${POBJS:S/${_D}.po//}
+.endif
 .endfor
 .endfor
+beforedepend: ${DHDRS}
+beforebuild: ${DHDRS}
 .endif
 
 .if !target(depend)

Modified: stable/10/share/mk/bsd.lib.mk
==============================================================================
--- stable/10/share/mk/bsd.lib.mk	Wed Aug 13 15:50:16 2014	(r269945)
+++ stable/10/share/mk/bsd.lib.mk	Wed Aug 13 16:11:57 2014	(r269946)
@@ -117,7 +117,8 @@ PO_FLAG=-pg
 	${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 	${CTFCONVERT_CMD}
 
-all: objwarn
+all: beforebuild .WAIT
+beforebuild: objwarn
 
 .if defined(PRIVATELIB)
 _LIBDIR:=${LIBPRIVATEDIR}

Modified: stable/10/share/mk/bsd.prog.mk
==============================================================================
--- stable/10/share/mk/bsd.prog.mk	Wed Aug 13 15:50:16 2014	(r269945)
+++ stable/10/share/mk/bsd.prog.mk	Wed Aug 13 16:11:57 2014	(r269946)
@@ -146,7 +146,8 @@ MAN1=	${MAN}
 .endif
 .endif # defined(PROG)
 
-all: objwarn ${PROG} ${SCRIPTS}
+all: beforebuild .WAIT ${PROG} ${SCRIPTS}
+beforebuild: objwarn
 .if ${MK_MAN} != "no"
 all: _manpages
 .endif



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