]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - gnu/usr.bin/binutils/ld/Makefile
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / gnu / usr.bin / binutils / ld / Makefile
1 # $FreeBSD$
2
3 .include "../Makefile.inc0"
4 .include <bsd.own.mk>
5
6 .PATH: ${SRCDIR}/ld
7
8 .if ${TARGET_ARCH} == "ia64"
9 CFLAGS+= -O1
10 .endif
11
12 PROG=   ld
13 SCRIPTDIR= /usr/libdata/ldscripts
14 SRCS+=  ldcref.c \
15         ldctor.c \
16         ldemul-list.h \
17         ldemul.c \
18         ldexp.c \
19         ldfile.c \
20         ldgram.y \
21         ldlang.c \
22         ldlex.l \
23         ldmain.c \
24         ldmisc.c \
25         ldver.c \
26         ldwrite.c \
27         lexsup.c \
28         mri.c
29
30 CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
31 CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
32 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
33 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
34 CFLAGS+= -DBINDIR=\"${BINDIR}\"
35 .if defined(TOOLS_PREFIX)
36 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
37 .else
38 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"/\"
39 .endif
40 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\"
41 CFLAGS+= -D_GNU_SOURCE
42 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
43 .if ${MK_SHARED_TOOLCHAIN} == "no"
44 NO_SHARED?= yes
45 .endif
46 DPADD=  ${RELTOP}/libbfd/libbfd.a
47 DPADD+= ${RELTOP}/libiberty/libiberty.a
48 LDADD=  ${DPADD}
49 CLEANDIRS+=     ldscripts
50 CLEANFILES+=    ldemul-list.h stringify.sed
51
52 HOST=           ${TARGET_TUPLE}
53 LIBSEARCHPATH=  \"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\"
54 ELF_SCR_EXT=    x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw
55 .for ext in ${ELF_SCR_EXT}
56 LDSCRIPTS+=     ${NATIVE_EMULATION}.${ext}
57 .endfor
58
59 EMXFR=
60 EMLST=
61 .for _e in ${NATIVE_EMULATION} ${EMS}
62 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
63 EMLST+= &ld_${_e}_emulation,
64 .endfor
65
66 ldemul-list.h:
67         echo "${EMXFR}" > ${.TARGET}
68         echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
69
70 stringify.sed:
71         ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
72
73 afterinstall:
74         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
75             ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
76
77 .include <bsd.prog.mk>