d2a145264cb4fa343b6583b288762893ba0354f8
[dragonfly.git] / gnu / usr.bin / binutils / ld / Makefile
1 # $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.8.2.8 2002/09/01 23:39:14 obrien Exp $
2 # $DragonFly: src/gnu/usr.bin/binutils/ld/Attic/Makefile,v 1.2 2003/06/17 04:25:44 dillon Exp $
3
4 .include "../Makefile.inc0"
5
6 .PATH: ${SRCDIR}/ld
7
8 PROG=   ld
9 SCRIPTDIR= /usr/libdata/ldscripts
10 SRCS+=  ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
11         ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \
12         ldver.c ldwrite.c lexsup.c mri.c
13
14 .if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h)
15 SRCS+=  elf-hints.h
16 CLEANFILES+=    elf-hints.h
17
18 elf-hints.h:
19         ln -sf ${.CURDIR}/../../../../include/${.TARGET} .
20 .endif
21
22 WARNS=  1
23 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
24 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
25 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
26 NOSHARED?= yes
27 DPADD=  ${RELTOP}/libbfd/libbfd.a
28 DPADD+= ${RELTOP}/libiberty/libiberty.a
29 LDADD=  ${DPADD}
30 CLEANDIRS+=     ldscripts
31 CLEANFILES+=    ldemul-list.h stringify.sed
32
33 # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
34 # binutils release. FreeBSD only distributes the bits that are required to
35 # build native architectures. BINUTILSDISTDIR is needed to build cross tools.
36 .if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
37 .PATH: ${BINUTILSDISTDIR}/ld
38 CFLAGS+= -I${BINUTILSDISTDIR}/ld
39 .endif
40
41 EMXFR=
42 EMLST=
43 .for _e in ${EMS}
44 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
45 EMLST+= &ld_${_e}_emulation,
46 .endfor
47
48 ldemul-list.h:
49         echo "${EMXFR}" > ${.TARGET}
50         echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
51
52 stringify.sed:
53         ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
54
55 afterinstall:
56         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
57             ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
58
59 .include <bsd.prog.mk>