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