Replace binutils 2.24 with latest binutils 2.27.
[dragonfly.git] / gnu / usr.bin / binutils224 / ld / Makefile
blob36f3caab0993b4069c35d516229a7903eb4bd3c1
1 ELF_SCR_EXT= x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw
3 .include "../Makefile.inc0"
4 .include "../Makefile.inc1"
6 .PATH: ${SRCDIR}/ld
8 PROG= ld.bfd
9 MFILE= ld${MANPAGEVER}.1
10 MAN= ${MFILE}
11 LIBEXEC_BINUTILS= ${BINDIR}/..
12 SCRIPTDIR= ${LIBEXEC_BINUTILS}/ldscripts
13 SRCS+= ldgram.y \
14 ldlex.l \
15 lexsup.c \
16 ldlang.c \
17 mri.c \
18 ldctor.c \
19 ldmain.c \
20 ldwrite.c \
21 ldexp.c \
22 ldemul.c \
23 ldver.c \
24 ldmisc.c \
25 ldfile.c \
26 ldcref.c \
27 plugin.c
29 SRCS+= ldemul-list.h
31 WARNS= 1
32 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
33 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
34 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
35 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
36 CFLAGS+= -DENABLE_PLUGINS -DHAVE_CONFIG_H
37 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${USRDATA_PREFIX}\"
38 # link-time optimization requires dlopen() which means ld cannot be built
39 # statically and also support -plugin, not even for cross-tools.
40 .undef NOSHARED
42 CLEANDIRS+= ldscripts tmpdir
43 CLEANFILES+= ldemul-list.h stringify.sed
45 EMXFR=
46 EMLST=
47 .for _e in ${EMS}
48 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
49 EMLST+= &ld_${_e}_emulation,
50 .endfor
52 ldemul-list.h:
53 echo "${EMXFR}" > ${.TARGET}
54 echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
56 stringify.sed:
57 ${LN} -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
59 ${MFILE}: ${SRCDIR}/ld/ld.1
60 cp ${.ALLSRC} ${.TARGET}
62 CLEANFILES+= ${MFILE}
64 .if defined(IS_PRIMARY)
65 MLINKS+= ${MFILE} ld.1
66 .endif
68 afterinstall: install-ldscripts
70 install-ldscripts: ${LDSCRIPTS:S|^|ldscripts/|}
71 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
72 ${.ALLSRC} ${DESTDIR}${SCRIPTDIR}
74 .include <bsd.prog.mk>