Switch the default binutils from 2.17 to 2.21.
[dragonfly.git] / gnu / usr.bin / binutils217 / ld / Makefile
1 ELF_SCR_EXT=    x xbn xn xr xs xu xc xsc
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/ld
6
7 PROG=   ld
8 MAN=    ld217.1
9 LIBEXEC_BINUTILS= /usr/libexec/binutils217
10 SCRIPTDIR= ${LIBEXEC_BINUTILS}/ldscripts
11 SRCS+=  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)
16 SRCS+=  elf-hints.h
17 CLEANFILES+=    elf-hints.h
18
19 elf-hints.h:
20         ${LN} -sf ${.CURDIR}/../../../../include/${.TARGET} .
21 .endif
22
23 WARNS=  1
24 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
25 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
26 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
27 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
28 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
29 NOSHARED?= yes
30 DPADD=  ${RELTOP}/libbfd/libbfd.a
31 DPADD+= ${RELTOP}/libiberty/libiberty.a
32 LDADD=  ${DPADD}
33 CLEANDIRS+=     ldscripts tmpdir
34 CLEANFILES+=    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
41 CFLAGS+= -I${BINUTILSDISTDIR}/ld
42 .endif
43
44 EMXFR=
45 EMLST=
46 .for _e in ${EMS}
47 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
48 EMLST+= &ld_${_e}_emulation,
49 .endfor
50
51 ldemul-list.h:
52         echo "${EMXFR}" > ${.TARGET}
53         echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
54
55 stringify.sed:
56         ${LN} -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
57
58 ld217.1: ${SRCDIR}/ld/ld.1
59         cp ${.ALLSRC} ${.TARGET}
60
61 CLEANFILES+=    ld217.1
62
63 afterinstall:
64         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
65             ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
66
67 .include <bsd.prog.mk>