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