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
This commit is contained in:
Rui Paulo 2010-09-10 16:21:09 +00:00
parent 9a1d115000
commit c2c48445ba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212423
2 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -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