summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2014-08-13 01:27:51 +0000
committerrpaulo <rpaulo@FreeBSD.org>2014-08-13 01:27:51 +0000
commitabf7fb0281dd6e12d9cde40dfe3be59ee9bd6708 (patch)
tree7760812f64ad1b3177ee9a4687b3cb8d91917867
parentccce21b06135e00db78d1c0cdc406ce9d48fd548 (diff)
downloadFreeBSD-src-abf7fb0281dd6e12d9cde40dfe3be59ee9bd6708.zip
FreeBSD-src-abf7fb0281dd6e12d9cde40dfe3be59ee9bd6708.tar.gz
Make sure the DTrace header files are built before depend and before
the build starts. This adds a new variable DHDRS that contains a list of all DTrace header files. Then, we use the beforedepend hook to make sure the heaeder files are built. Introduce a beforebuild dependency (from projects/bmake) based on feedback from Simon J. Gerraty. This lets us generate the header files without running make depend. Reviewed by: sjg, imp MFC after: 3 days
-rw-r--r--share/mk/bsd.dep.mk3
-rw-r--r--share/mk/bsd.lib.mk3
-rw-r--r--share/mk/bsd.prog.mk3
3 files changed, 7 insertions, 2 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index a15a70d..14619eb 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -129,6 +129,7 @@ CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR}
.endif
.for _DSRC in ${SRCS:M*.d:N*/*}
.for _D in ${_DSRC:R}
+DHDRS+= ${_D}.h
${_D}.h: ${_DSRC}
${DTRACE} -xnolibs -h -s ${.ALLSRC}
SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/}
@@ -148,6 +149,8 @@ ${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//}
.endif
.endfor
.endfor
+beforedepend: ${DHDRS}
+beforebuild: ${DHDRS}
.endif
.if !target(depend)
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 509150d..f0acf16 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -118,7 +118,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}
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 229ce8e..b83e2ca 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -159,7 +159,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
OpenPOWER on IntegriCloud