1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1998-03-12 02:55:43 +00:00
|
|
|
|
|
|
|
.include "../Makefile.inc0"
|
|
|
|
|
|
|
|
.PATH: ${SRCDIR}/ld
|
|
|
|
|
2001-10-14 01:57:19 +00:00
|
|
|
PROG= ld
|
|
|
|
SCRIPTDIR= /usr/libdata/ldscripts
|
|
|
|
SRCS+= ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
|
|
|
|
ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \
|
|
|
|
ldver.c ldwrite.c lexsup.c mri.c
|
2001-09-24 09:25:05 +00:00
|
|
|
|
|
|
|
.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h)
|
2001-10-14 01:57:19 +00:00
|
|
|
SRCS+= elf-hints.h
|
2001-09-24 09:25:05 +00:00
|
|
|
CLEANFILES+= elf-hints.h
|
|
|
|
elf-hints.h:
|
2001-10-14 01:57:19 +00:00
|
|
|
ln -sf ${.CURDIR}/../../../../include/${.TARGET} .
|
2001-09-24 09:25:05 +00:00
|
|
|
.endif
|
|
|
|
|
2001-10-14 01:57:19 +00:00
|
|
|
CFLAGS+= -DSCRIPTDIR=\"${DESTDIR}/usr/libdata\"
|
|
|
|
CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
|
|
|
|
CFLAGS+= -DVERSION=\"${VERSION}\" -DBFD_VERSION=\"${VERSION}\"
|
|
|
|
NOSHARED?= yes
|
|
|
|
DPADD= ${RELTOP}/libbfd/libbfd.a
|
|
|
|
DPADD+= ${RELTOP}/libiberty/libiberty.a
|
|
|
|
LDADD= ${DPADD}
|
1998-03-12 02:55:43 +00:00
|
|
|
CLEANDIRS+= ldscripts
|
2000-05-22 08:09:42 +00:00
|
|
|
CLEANFILES+= ldemul-list.h stringify.sed
|
1998-05-04 21:38:46 +00:00
|
|
|
|
1999-11-06 22:36:40 +00:00
|
|
|
# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
|
|
|
|
# binutils release. FreeBSD only distributes the bits that are required to
|
|
|
|
# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
|
2001-10-14 01:57:19 +00:00
|
|
|
.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
|
|
|
|
.PATH: ${BINUTILSDISTDIR}/ld
|
|
|
|
CFLAGS+= -I${BINUTILSDISTDIR}/ld
|
1999-11-06 22:36:40 +00:00
|
|
|
.endif
|
|
|
|
|
1998-05-04 21:38:46 +00:00
|
|
|
EMXFR=
|
|
|
|
EMLST=
|
|
|
|
.for _e in ${EMS}
|
2001-10-14 01:57:19 +00:00
|
|
|
EMXFR+= extern ld_emulation_xfer_type ${_e};
|
1998-05-04 21:38:46 +00:00
|
|
|
EMLST+= &${_e},
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
ldemul-list.h:
|
2001-10-14 01:57:19 +00:00
|
|
|
echo "${EMXFR}" > ${.TARGET}
|
|
|
|
echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
|
1998-05-04 21:38:46 +00:00
|
|
|
|
2000-05-22 08:09:42 +00:00
|
|
|
stringify.sed:
|
2000-11-25 13:56:28 +00:00
|
|
|
ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
|
2000-05-22 08:09:42 +00:00
|
|
|
|
1998-03-12 02:55:43 +00:00
|
|
|
afterinstall:
|
|
|
|
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
|
|
${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|