summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-09-10 16:21:09 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-09-10 16:21:09 +0000
commitd817977e310b98de2359b9a182bf34f2c6f56de6 (patch)
treeff2d0da3868d361bca9f6dc83ff8c02c910ecb4d
parentf721403d777e12a8c93023d67967be4a584bd59e (diff)
downloadFreeBSD-src-d817977e310b98de2359b9a182bf34f2c6f56de6.zip
FreeBSD-src-d817977e310b98de2359b9a182bf34f2c6f56de6.tar.gz
Check the existence of a 'beforelinking' target and make the resulting
program or library depend on that before doing the final linking. This will be needed by DTrace. Sponsored by: The FreeBSD Foundation
-rw-r--r--share/mk/bsd.lib.mk4
-rw-r--r--share/mk/bsd.prog.mk10
2 files changed, 13 insertions, 1 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index ecb91bf..4da0a2f 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -198,7 +198,11 @@ SOBJS+= ${OBJS:.o=.So}
.if defined(SHLIB_NAME)
_LIBS+= ${SHLIB_NAME}
+.if target(beforelinking)
+${SHLIB_NAME}: ${SOBJS} beforelinking
+.else
${SHLIB_NAME}: ${SOBJS}
+.endif
@${ECHO} building shared library ${SHLIB_NAME}
@rm -f ${.TARGET} ${SHLIB_LINK}
.if defined(SHLIB_LINK)
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index f483a7e..06a89d8 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -60,7 +60,11 @@ LDADD+= -lobjc -lpthread
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
-${PROG}: ${OBJS}
+.if target(beforelinking)
+${PROG}: ${OBJS} beforelinking
+.else
+${PROG}: ${OBJS} beforelinking
+.endif
.if defined(PROG_CXX)
${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.else
@@ -86,7 +90,11 @@ SRCS= ${PROG}.c
# - it's useful to keep objects around for crunching.
OBJS= ${PROG}.o
+.if target(beforelinking)
+${PROG}: ${OBJS} beforelinking
+.else
${PROG}: ${OBJS}
+.endif
.if defined(PROG_CXX)
${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.else
OpenPOWER on IntegriCloud