aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rtld-elf/Makefile')
-rw-r--r--libexec/rtld-elf/Makefile20
1 files changed, 12 insertions, 8 deletions
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 0bbfbb89301e4..67ec1eb35cb07 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -4,6 +4,8 @@
# linker:
# make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all
+RTLD_ELF_DIR:= ${.PARSEDIR}
+
.include <src.opts.mk>
PACKAGE= clibs
MK_PIE= no # Always position independent using local rules
@@ -25,16 +27,16 @@ SRCS= \
xmalloc.c \
debug.c \
libmap.c
-MAN= rtld.1
+MAN?= rtld.1
CSTD?= gnu99
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
CFLAGS+= -I${SRCTOP}/lib/csu/common
-.if exists(${.CURDIR}/${MACHINE_ARCH})
+.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH})
RTLD_ARCH= ${MACHINE_ARCH}
.else
RTLD_ARCH= ${MACHINE_CPUARCH}
.endif
-CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR}
+CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR}
.if ${MACHINE_ARCH} == "powerpc64"
LDFLAGS+= -nostdlib -e _rtld_start
.else
@@ -81,16 +83,16 @@ LIBADD+= compiler_rt
.if ${MK_SYMVER} == "yes"
VERSION_DEF= ${LIBCSRCDIR}/Versions.def
-SYMBOL_MAPS= ${.CURDIR}/Symbol.map
+SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map
VERSION_MAP= Version.map
LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
-.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map)
-SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map
+.if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map)
+SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map
.endif
.endif
-.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc"
+.sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc"
# Since moving rtld-elf to /libexec, we need to create a symlink.
# Fixup the existing binary that's there so we can symlink over it.
@@ -99,10 +101,12 @@ beforeinstall:
-chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
.endif
-.PATH: ${.CURDIR}/${RTLD_ARCH}
+.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH}
+.if ${.CURDIR} == ${RTLD_ELF_DIR}
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
+.endif
.include <bsd.prog.mk>
${PROG_FULL}: ${VERSION_MAP}