SUBDIR=		bar
.if !defined(DYN)
PROG=		hello
LDFLAGS=	-static
CLEANFILES+=	hello-dyn
.else
PROG=		hello-dyn
LDFLAGS=	-export-dynamic
CLEANFILES+=	hello
.endif
SRCS=		hello.c

.if !defined(DYN)
.if exists(rtld-elf)
RTLD_SRC=	rtld-elf
.endif
RTLD_SRC?=	/usr/src/libexec/rtld-elf
SRCS+=		debug.c lockdflt.c map_object.c reloc.c rtld.c rtld_start.S\
		xmalloc.c
CFLAGS+=	-DLIBDL -I ${RTLD_SRC} -I ${RTLD_SRC}/${MACHINE_ARCH} -g -DDEBUG

.if exists(${MACHINE_ARCH}/Makefile.inc)
.include "${MACHINE_ARCH}/Makefile.inc"
.endif

.PATH:          ${RTLD_SRC} ${RTLD_SRC}/${MACHINE_ARCH}
.endif

.include "Makefile.inc"
.include <bsd.prog.mk>
.include <bsd.subdir.mk>
