Makefile revision 52938
1#
2# $FreeBSD: head/gnu/usr.bin/binutils/ld/Makefile 52938 1999-11-06 22:36:40Z jb $
3#
4
5.include "../Makefile.inc0"
6
7.PATH: ${SRCDIR}/ld
8
9PROG=		ld
10SCRIPTDIR=	/usr/libdata/ldscripts
11SRCS+=		ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
12		ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \
13		ldver.c ldwrite.c lexsup.c mri.c
14CFLAGS+=	-DSCRIPTDIR=\"${DESTDIR}/usr/libdata\"
15CFLAGS+=	-I${SRCDIR}/ld
16LDADD+=		-L${RELTOP}/libbfd -lbfd
17LDADD+=		-L${RELTOP}/libiberty -liberty
18DPADD+=		${RELTOP}/libbfd/libbfd.a
19DPADD+=		${RELTOP}/libiberty/libiberty.a
20CLEANDIRS+=	ldscripts
21CLEANFILES+=	ldemul-list.h
22
23# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
24# binutils release. FreeBSD only distributes the bits that are required to
25# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
26.if	defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
27.PATH:		${BINUTILSDISTDIR}/ld
28CFLAGS+=	-I${BINUTILSDISTDIR}/ld
29.endif
30
31EMXFR=
32EMLST=
33.for _e in ${EMS}
34EMXFR+= extern ld_emulation_xfer_type ${_e};
35EMLST+=	&${_e},
36.endfor
37
38ldemul-list.h:
39	echo "${EMXFR}" > ldemul-list.h
40	echo "#define EMULATION_LIST ${EMLST} 0" >> ldemul-list.h
41
42afterinstall:
43	${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
44	    ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
45
46.include <bsd.prog.mk>
47