aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib/drti/Makefile
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2010-08-21 13:48:04 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2010-08-21 13:48:04 +0000
commit513bdf9ac019c983b2bb0352b867d811f5d28a6e (patch)
tree10541a784d24f1a6019cd266eb1b8ed7867ed89c /cddl/lib/drti/Makefile
parent9510083e01984af6328f9e167c2fcf72525bc8a8 (diff)
downloadsrc-513bdf9ac019c983b2bb0352b867d811f5d28a6e.tar.gz
src-513bdf9ac019c983b2bb0352b867d811f5d28a6e.zip
Link drti.o with a PIC version of libelf. This is needed because
drti.o depends on libelf and this avoids linking every other drti.o program (namely programs with USDT probes) with libelf. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=211561
Diffstat (limited to 'cddl/lib/drti/Makefile')
-rw-r--r--cddl/lib/drti/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/cddl/lib/drti/Makefile b/cddl/lib/drti/Makefile
index ffd161c89d2a..57b161f74e17 100644
--- a/cddl/lib/drti/Makefile
+++ b/cddl/lib/drti/Makefile
@@ -8,13 +8,20 @@ FILESOWN= ${LIBOWN}
FILESGRP= ${LIBGRP}
FILESMODE= ${LIBMODE}
FILESDIR= ${LIBDIR}/dtrace
-CLEANFILES= ${FILES}
+CLEANFILES= ${FILES} ${FILES}.tmp
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
-I${OPENSOLARIS_USR_DISTDIR}/head \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
- -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
+ -DPIC -fpic
+
+.c.o:
+ ${CC} ${CFLAGS} -c ${.IMPSRC}
+ mv ${FILES} ${FILES}.tmp
+ ${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
+ rm -f ${FILES}.tmp
.include <bsd.prog.mk>