aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2010-09-10 16:21:09 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2010-09-10 16:21:09 +0000
commitc2c48445bad6ac76cacf4859f41dd2b93143fa6b (patch)
treeff2d0da3868d361bca9f6dc83ff8c02c910ecb4d
parent9a1d11500003d4b4df561d1b3369a127db072fff (diff)
downloadsrc-c2c48445bad6ac76cacf4859f41dd2b93143fa6b.tar.gz
src-c2c48445bad6ac76cacf4859f41dd2b93143fa6b.zip
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
Notes
Notes: svn path=/head/; revision=212423
-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 ecb91bfd2883..4da0a2fe45e4 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 f483a7eac528..06a89d8e0dcb 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