1998-12-17 16:59:05 +03:00
|
|
|
# $NetBSD: Makefile,v 1.4 1998/12/17 13:59:05 mrg Exp $
|
1998-09-30 20:47:47 +04:00
|
|
|
|
|
|
|
# XXX set MACHINE_GNU_ARCH for _<arch>.mk
|
|
|
|
.include <bsd.own.mk>
|
1998-08-28 00:47:21 +04:00
|
|
|
|
|
|
|
PROG= ld
|
|
|
|
|
|
|
|
SRCS= ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c ldmain.c ldmisc.c \
|
|
|
|
ldver.c ldwrite.c lexsup.c mri.c ldcref.c ldgram.y ldlex.l
|
1998-08-28 01:20:46 +04:00
|
|
|
MAN= ld.1
|
|
|
|
YHEADER=1
|
1998-12-17 16:59:05 +03:00
|
|
|
SCRIPTDIR= /usr/libdata
|
1998-08-28 00:47:21 +04:00
|
|
|
|
|
|
|
CPPFLAGS+= -I. -I${.CURDIR} -I${BFDOBJ} -I${DIST}/ld \
|
|
|
|
-I${DIST}/bfd -I${DIST}/include \
|
|
|
|
-DDEFAULT_EMULATION='"${DEFAULT_EMUL}"' \
|
1998-12-17 16:59:05 +03:00
|
|
|
-DSCRIPTDIR=\"${SCRIPTDIR}\" \
|
1998-08-28 00:47:21 +04:00
|
|
|
-DTARGET='"${MACHINE_GNU_ARCH}--netbsd"' \
|
|
|
|
-DEMULATION_LIST='${EMULS:S/^/\&ld_/:S/$/_emulation,/} 0'
|
1998-08-28 01:20:46 +04:00
|
|
|
|
|
|
|
# gets these from BFDOBJ since ld uses bfd internal headers
|
1998-08-28 00:47:21 +04:00
|
|
|
DPADD+= ${BFDOBJ}/libbfd_pic.a
|
|
|
|
LDADD+= -L${BFDOBJ} -lbfd
|
|
|
|
|
|
|
|
DIST= ${.CURDIR}/../../dist
|
|
|
|
BFDOBJ!= cd ${.CURDIR}/../../lib/bfd; ${MAKE} print-objdir
|
|
|
|
|
|
|
|
.PATH: ${DIST}/ld
|
|
|
|
|
1998-09-30 20:47:47 +04:00
|
|
|
.include "_${MACHINE_ARCH}.mk"
|
|
|
|
|
1998-08-28 00:47:21 +04:00
|
|
|
LIB_PATH= ${LIBDIR} # passed to genscripts.sh
|
|
|
|
|
|
|
|
.for _EMUL_ in ${EMULS}
|
|
|
|
SRCS+= e${_EMUL_}.c
|
1998-08-28 01:20:46 +04:00
|
|
|
CLEANFILES+= e${_EMUL_}.c
|
1998-08-28 00:47:21 +04:00
|
|
|
e${_EMUL_}.c: ${DIST}/ld/genscripts.sh ${DIST}/ld/emulparams/${_EMUL_}.sh
|
1998-08-28 01:20:46 +04:00
|
|
|
sh ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} \
|
1998-08-28 00:47:21 +04:00
|
|
|
${MACHINE_GNU_ARCH}-netbsd ${MACHINE_GNU_ARCH}-netbsd \
|
|
|
|
${MACHINE_GNU_ARCH}-netbsd ${DEFAULT_EMUL} \
|
|
|
|
"" ${_EMUL_}
|
|
|
|
.endfor
|
|
|
|
|
1998-12-17 16:59:05 +03:00
|
|
|
afterinstall:
|
|
|
|
pax -rw ldscripts ${DESTDIR}${SCRIPTDIR}
|
|
|
|
|
1998-08-28 00:47:21 +04:00
|
|
|
cleanprog: __cleanldscripts
|
|
|
|
__cleanldscripts:
|
|
|
|
rm -rf ldscripts
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|