2003-10-21 14:01:19 +04:00
|
|
|
# $NetBSD: Makefile,v 1.44 2003/10/21 10:01:20 lukem Exp $
|
1998-12-17 14:34:10 +03:00
|
|
|
|
2002-11-12 17:33:48 +03:00
|
|
|
.include <bsd.own.mk> # for OBJECT_FMT definition
|
|
|
|
.include <bsd.shlib.mk> # for SHLINKINSTALLDIR definition
|
1999-02-09 23:27:04 +03:00
|
|
|
.if (${OBJECT_FMT} == "a.out")
|
1993-10-17 00:54:08 +03:00
|
|
|
PROG= ld.so
|
1998-12-17 14:34:10 +03:00
|
|
|
SRCS= mdprologue.S rtld.c malloc.c shlib.c md.c vfprintf.c
|
2002-11-12 17:33:48 +03:00
|
|
|
BINDIR= ${SHLINKINSTALLDIR}
|
|
|
|
|
2002-08-19 17:54:34 +04:00
|
|
|
CLIB= ${NETBSDSRCDIR}/lib/libc
|
2002-03-06 00:53:56 +03:00
|
|
|
CLIBOBJ!=cd ${CLIB} && ${PRINTOBJDIR}
|
1998-07-25 16:37:27 +04:00
|
|
|
PICFLAG=-fpic -fno-function-cse
|
1998-12-17 14:34:10 +03:00
|
|
|
CPPFLAGS+=$(PICFLAG) -DRTLD -DLIBC_SCCS \
|
|
|
|
-I${CLIB}/include -I$(.CURDIR)/arch/$(MACHINE_ARCH) -I$(.CURDIR)
|
1998-08-13 11:34:05 +04:00
|
|
|
.if defined(DEBUG)
|
|
|
|
CPPFLAGS+=-DDEBUG
|
|
|
|
.endif
|
2002-11-12 17:33:48 +03:00
|
|
|
.if ${SHLIBINSTALLDIR} != ${LIBDIR}
|
|
|
|
CPPFLAGS+=-DSTANDARD_SEARCH_DIRS=\"${SHLIBINSTALLDIR}\",\"${LIBDIR}\"
|
|
|
|
.endif
|
1993-12-10 08:10:22 +03:00
|
|
|
ASFLAGS+=-k
|
1998-05-21 04:31:05 +04:00
|
|
|
LDFLAGS+=-Bshareable -Bsymbolic -assert nosymbolic -L${CLIBOBJ}
|
1997-06-01 01:21:13 +04:00
|
|
|
.if defined(DESTDIR)
|
|
|
|
LDFLAGS+= -nostdlib -L${DESTDIR}/usr/lib
|
1996-06-09 02:22:26 +04:00
|
|
|
.endif
|
1993-12-10 08:10:22 +03:00
|
|
|
LDADD+= -lc_pic
|
1997-03-25 01:02:40 +03:00
|
|
|
DPADD+= ${LIBC_PIC}
|
1993-10-17 00:54:08 +03:00
|
|
|
|
1998-12-17 14:34:10 +03:00
|
|
|
.PATH: ${CLIB}/stdio $(.CURDIR)/arch/$(MACHINE_ARCH)
|
1993-10-17 00:54:08 +03:00
|
|
|
|
|
|
|
$(PROG):
|
1993-12-10 08:10:22 +03:00
|
|
|
$(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LDADD)
|
1993-10-17 00:54:08 +03:00
|
|
|
|
|
|
|
.S.o:
|
1993-12-10 08:10:22 +03:00
|
|
|
${CPP} ${.IMPSRC} | ${AS} ${ASFLAGS} -o ${.TARGET} -
|
2002-11-12 17:33:48 +03:00
|
|
|
|
|
|
|
.if ${SHLINKINSTALLDIR} != "/usr/libexec"
|
|
|
|
SYMLINKS+= ${SHLINKINSTALLDIR}/${PROG} /usr/libexec/${PROG}
|
|
|
|
.endif
|
|
|
|
|
2001-04-18 15:48:21 +04:00
|
|
|
.elif (${OBJECT_FMT} == "ELF" && \
|
2002-02-06 23:36:18 +03:00
|
|
|
(${MACHINE_ARCH} == "arm" || \
|
2002-01-22 19:27:51 +03:00
|
|
|
${MACHINE_ARCH} == "i386" || \
|
2001-04-18 15:48:21 +04:00
|
|
|
${MACHINE_ARCH} == "m68k" || \
|
2002-03-29 12:48:49 +03:00
|
|
|
${MACHINE_ARCH} == "sparc" || \
|
|
|
|
${MACHINE_ARCH} == "vax"))
|
2000-09-12 03:23:21 +04:00
|
|
|
|
|
|
|
FILES= ld.so
|
2000-09-12 20:39:51 +04:00
|
|
|
FILESDIR= /usr/libexec
|
2000-09-12 03:23:21 +04:00
|
|
|
FILESMODE= ${BINMODE}
|
|
|
|
CLEANFILES+= ld.so
|
|
|
|
|
2000-09-12 20:39:51 +04:00
|
|
|
all dependall: ${FILES}
|
2000-09-12 03:23:21 +04:00
|
|
|
|
|
|
|
ld.so: ${.CURDIR}/ld.so.${MACHINE_ARCH}.uue
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-10 14:33:58 +04:00
|
|
|
${TOOL_UUDECODE} ${.ALLSRC}
|
2000-09-12 03:23:21 +04:00
|
|
|
|
1997-06-23 17:25:41 +04:00
|
|
|
.endif
|
|
|
|
|
2001-05-06 17:54:04 +04:00
|
|
|
MAN= ld.aout_so.1
|
1993-10-17 00:54:08 +03:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|