05e4e639beab5f3d4d0ab1cf07eedb14b1555784
[dragonfly.git] / gnu / usr.bin / binutils217 / ld / Makefile
1 # $DragonFly: src/gnu/usr.bin/binutils217/ld/Makefile,v 1.1 2007/04/13 12:24:32 corecode Exp $
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/ld
6
7 PROG=   ld
8 LIBEXEC_BINUTILS= /usr/libexec/binutils217
9 SCRIPTDIR= ${LIBEXEC_BINUTILS}/ldscripts
10 SRCS+=  ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
11         ldgram.c ldlang.c ldlex.c 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}${LIBEXEC_BINUTILS}\"
24 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
25 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
26 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
27 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
28 NOSHARED?= yes
29 DPADD=  ${RELTOP}/libbfd/libbfd.a
30 DPADD+= ${RELTOP}/libiberty/libiberty.a
31 LDADD=  ${DPADD}
32 CLEANDIRS+=     ldscripts tmpdir
33 CLEANFILES+=    ldemul-list.h stringify.sed
34
35 # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
36 # binutils release. FreeBSD only distributes the bits that are required to
37 # build native architectures. BINUTILSDISTDIR is needed to build cross tools.
38 .if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
39 .PATH: ${BINUTILSDISTDIR}/ld
40 CFLAGS+= -I${BINUTILSDISTDIR}/ld
41 .endif
42
43 EMXFR=
44 EMLST=
45 .for _e in ${EMS}
46 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
47 EMLST+= &ld_${_e}_emulation,
48 .endfor
49
50 ldemul-list.h:
51         echo "${EMXFR}" > ${.TARGET}
52         echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
53
54 stringify.sed:
55         ${LN} -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
56
57 afterinstall:
58         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
59             ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
60
61 .include <bsd.prog.mk>