1# $FreeBSD$ 2 3.include <bsd.own.mk> 4 5PROG?= ld-elf.so.1 6SRCS= rtld_start.S \ 7 reloc.c rtld.c rtld_lock.c map_object.c \ 8 malloc.c xmalloc.c debug.c libmap.c 9MAN= rtld.1 10CSTD?= gnu99 11CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD 12CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} 13LDFLAGS+= -nostdlib -e .rtld_start 14INSTALLFLAGS= -C -b 15PRECIOUSPROG= 16BINDIR= /libexec 17SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} 18MLINKS= rtld.1 ld-elf.so.1.1 \ 19 rtld.1 ld.so.1 20 21CFLAGS+= -fpic -DPIC 22LDFLAGS+= -shared -Wl,-Bsymbolic 23DPADD= ${LIBC_PIC} 24LDADD= -lc_pic 25 26.if ${MACHINE_ARCH} != "ia64" 27.if ${MK_SYMVER} == "yes" 28LIBCDIR= ${.CURDIR}/../../lib/libc 29VERSION_DEF= ${LIBCDIR}/Versions.def 30SYMBOL_MAPS= ${.CURDIR}/Symbol.map 31VERSION_MAP= Version.map 32LDFLAGS+= -Wl,--version-script=${VERSION_MAP} 33 34${PROG}: ${VERSION_MAP} 35 36.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map) 37SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map 38.endif 39.endif 40.endif 41 42.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc) 43.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" 44.endif 45 46# Since moving rtld-elf to /libexec, we need to create a symlink. 47# Fixup the existing binary that's there so we can symlink over it. 48beforeinstall: 49.if exists(${DESTDIR}/usr/libexec/${PROG}) 50 -chflags noschg ${DESTDIR}/usr/libexec/${PROG} 51.endif 52 53.PATH: ${.CURDIR}/${MACHINE_ARCH} 54 55.include <bsd.symver.mk> 56.include <bsd.prog.mk> 57