Dynamic root: Move ld-elf.so.2 to /libexec
[dragonfly.git] / libexec / rtld-elf / Makefile
CommitLineData
abfcd5b1 1# $FreeBSD$
984263bc 2
a1eee96a 3PROG= ld-elf.so.2
abfcd5b1
JM
4SRCS= rtld_start.S \
5 reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \
6 malloc.c xmalloc.c debug.c libmap.c
984263bc 7MAN= rtld.1
abfcd5b1 8CSTD?= gnu99
16dbe6a9
FT
9BINDIR= /libexec
10SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG}
8f5c3d2a
SW
11WARNS?= 2
12
fcf53d9b
JM
13# To activate LD_DEBUG functionality, define ENABLE_DEBUG
14# e.g. make -DENABLE_DEBUG
15
16CFLAGS+= -DIN_RTLD
17CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} -D__thread=
7f5c8f97 18CFLAGS+= -I${.CURDIR}/../../lib/csu/common
33d0682a 19LDFLAGS+= -nostdlib -e .rtld_start -Wl,--no-undefined
0a5ad630
JS
20INSTALLFLAGS= -C -b
21.ifndef NOFSCHG
22INSTALLFLAGS+= -fschg
23.endif
984263bc 24MLINKS= rtld.1 ld-elf.so.1.1
b6989f5b 25MLINKS+= rtld.1 ld-elf.so.2.1
40146e6a 26MLINKS+= rtld.1 _rtld_functrace.3
984263bc 27
f03f3171
JM
28.if !defined(NO_SYMVER)
29VERSION_DEF= ${.CURDIR}/../../lib/libc/Versions.def
30SYMBOL_MAPS= ${.CURDIR}/Symbol.map
31VERSION_MAP= Version.map
32LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
33
34rtld.c: ${VERSION_MAP}
35
36.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
37SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map
38.endif
39.endif
40
984263bc
MD
41.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
42.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
43.endif
44
984263bc
MD
45CFLAGS+= -fpic -DPIC
46LDFLAGS+= -shared -Wl,-Bsymbolic
d2a4c620
JS
47DPADD= ${.OBJDIR}/../../lib/libc_rtld/libc_rtld_pic.a
48LDADD= -L${.OBJDIR}/../../lib/libc_rtld -lc_rtld_pic
984263bc 49
fcf53d9b
JM
50.ifdef ENABLE_DEBUG
51CFLAGS+= -DDEBUG
52.endif
53
16dbe6a9
FT
54# Since moving rtld-elf to /libexec, we need to create a symlink.
55# Fixup the existing binary that's there so we can symlink over it.
56beforeinstall:
57.if exists(${DESTDIR}/usr/libexec/${PROG})
58 chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
59.endif
60
984263bc
MD
61.PATH: ${.CURDIR}/${MACHINE_ARCH}
62
f03f3171 63.include <bsd.symver.mk>
984263bc 64.include <bsd.prog.mk>