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