kernel/acpi: Ouch, add forgotten semicolon.
[dragonfly.git] / libexec / rtld-elf / Makefile
1 # $FreeBSD$
2
3 PROG=           ld-elf.so.2
4 SRCS=           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
7 MAN=            rtld.1
8 CSTD?=          gnu99
9 BINDIR=         /libexec
10 SYMLINKS=       ${BINDIR}/${PROG} /usr/libexec/${PROG}
11 WARNS?=         2
12
13 # To activate LD_DEBUG functionality, define ENABLE_DEBUG
14 # e.g. make -DENABLE_DEBUG
15
16 # for now do not let the use of -flto
17 .if ${CFLAGS:M-flto}
18 CFLAGS+=        -fno-lto
19 LDFLAGS+=       -flto
20 .endif
21
22 CFLAGS+=        -DIN_RTLD
23 CFLAGS+=        -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} -D__thread=
24 CFLAGS+=        -I${.CURDIR}/../../lib/csu/common
25 LDFLAGS+=       -nostdlib -e .rtld_start -Wl,--no-undefined
26 INSTALLFLAGS=   -C -b
27 .ifndef NOFSCHG
28 INSTALLFLAGS+=  -fschg
29 .endif
30 MLINKS=         rtld.1 ld-elf.so.1.1
31 MLINKS+=        rtld.1 ld-elf.so.2.1
32 MLINKS+=        rtld.1 _rtld_functrace.3
33
34 .if !defined(NO_SYMVER)
35 VERSION_DEF=    ${.CURDIR}/../../lib/libc/Versions.def
36 SYMBOL_MAPS=    ${.CURDIR}/Symbol.map
37 VERSION_MAP=    Version.map
38 LDFLAGS+=       -Wl,--version-script=${VERSION_MAP}
39
40 rtld.c:         ${VERSION_MAP}
41
42 .if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
43 SYMBOL_MAPS+=   ${.CURDIR}/${MACHINE_ARCH}/Symbol.map
44 .endif
45 .endif
46
47 .if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
48 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
49 .endif
50
51 CFLAGS+=        -fpic -DPIC
52 LDFLAGS+=       -shared -Wl,-Bsymbolic
53 DPADD=          ${.OBJDIR}/../../lib/libc_rtld/libc_rtld_pic.a
54 LDADD=          -L${.OBJDIR}/../../lib/libc_rtld -lc_rtld_pic
55
56 .ifdef ENABLE_DEBUG
57 CFLAGS+=        -DDEBUG
58 .endif
59
60 # Since moving rtld-elf to /libexec, we need to create a symlink.
61 # Fixup the existing binary that's there so we can symlink over it.
62 beforeinstall:
63 .if exists(${DESTDIR}/usr/libexec/${PROG})
64         chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
65 .endif
66
67 .PATH: ${.CURDIR}/${MACHINE_ARCH}
68
69 .include <bsd.symver.mk>
70 .include <bsd.prog.mk>