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