Switch the default binutils from 2.17 to 2.21.
[dragonfly.git] / gnu / usr.bin / binutils217 / ld / Makefile
CommitLineData
f7f85ed1
SS
1ELF_SCR_EXT= x xbn xn xr xs xu xc xsc
2
a968ac75
SS
3.include "../Makefile.inc0"
4
5.PATH: ${SRCDIR}/ld
6
7PROG= ld
53bd31cd 8MAN= ld217.1
a968ac75
SS
9LIBEXEC_BINUTILS= /usr/libexec/binutils217
10SCRIPTDIR= ${LIBEXEC_BINUTILS}/ldscripts
11SRCS+= ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
12 ldgram.c ldlang.c ldlex.c ldmain.c ldmisc.c \
13 ldver.c ldwrite.c lexsup.c mri.c
14
15.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h)
16SRCS+= elf-hints.h
17CLEANFILES+= elf-hints.h
18
19elf-hints.h:
20 ${LN} -sf ${.CURDIR}/../../../../include/${.TARGET} .
21.endif
22
23WARNS= 1
24CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
25CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
26CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
27CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
28CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
29NOSHARED?= yes
30DPADD= ${RELTOP}/libbfd/libbfd.a
31DPADD+= ${RELTOP}/libiberty/libiberty.a
32LDADD= ${DPADD}
33CLEANDIRS+= ldscripts tmpdir
34CLEANFILES+= ldemul-list.h stringify.sed
35
36# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
37# binutils release. FreeBSD only distributes the bits that are required to
38# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
39.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
40.PATH: ${BINUTILSDISTDIR}/ld
41CFLAGS+= -I${BINUTILSDISTDIR}/ld
42.endif
43
44EMXFR=
45EMLST=
46.for _e in ${EMS}
47EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
48EMLST+= &ld_${_e}_emulation,
49.endfor
50
51ldemul-list.h:
52 echo "${EMXFR}" > ${.TARGET}
53 echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
54
55stringify.sed:
56 ${LN} -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
57
53bd31cd
SW
58ld217.1: ${SRCDIR}/ld/ld.1
59 cp ${.ALLSRC} ${.TARGET}
60
61CLEANFILES+= ld217.1
62
a968ac75
SS
63afterinstall:
64 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
65 ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
66
67.include <bsd.prog.mk>