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