- clean up a leftover in binutils215/ld
[dragonfly.git] / gnu / usr.bin / binutils215 / ld / Makefile
1 # $DragonFly: src/gnu/usr.bin/binutils215/ld/Attic/Makefile,v 1.2 2005/01/10 05:00:37 y0netan1 Exp $
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/ld
6
7 PROG=   ld
8 LIBEXEC_BINUTILS= /usr/libexec/binutils215
9 SCRIPTDIR= ${LIBEXEC_BINUTILS}/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 CONTRIBDIR=     ${SRCDIR}/ld
15 CLEANFILES+=    emultempl/elf32.em genscripts.sh
16
17 emultempl/elf32.em: ${CONTRIBDIR}/emultempl/elf32.em patches/elf32.em.patch
18         mkdir -p emultempl
19         patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/${.TARGET}
20
21 genscripts.sh: ${CONTRIBDIR}/genscripts.sh patches/genscripts.sh.patch
22         patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/${.TARGET}
23
24 depend: emultempl/elf32.em genscripts.sh
25
26 .if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h)
27 SRCS+=  elf-hints.h
28 CLEANFILES+=    elf-hints.h
29
30 elf-hints.h:
31         ln -sf ${.CURDIR}/../../../../include/${.TARGET} .
32 .endif
33
34 WARNS=  1
35 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
36 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
37 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
38 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
39 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
40 NOSHARED?= yes
41 DPADD=  ${RELTOP}/libbfd/libbfd.a
42 DPADD+= ${RELTOP}/libiberty/libiberty.a
43 LDADD=  ${DPADD}
44 CLEANDIRS+=     ldscripts
45 CLEANFILES+=    ldemul-list.h stringify.sed
46
47 # If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
48 # binutils release. FreeBSD only distributes the bits that are required to
49 # build native architectures. BINUTILSDISTDIR is needed to build cross tools.
50 .if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
51 .PATH: ${BINUTILSDISTDIR}/ld
52 CFLAGS+= -I${BINUTILSDISTDIR}/ld
53 .endif
54
55 EMXFR=
56 EMLST=
57 .for _e in ${EMS}
58 EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
59 EMLST+= &ld_${_e}_emulation,
60 .endfor
61
62 ldemul-list.h:
63         echo "${EMXFR}" > ${.TARGET}
64         echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
65
66 stringify.sed:
67         ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
68
69 afterinstall:
70         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
71             ${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
72
73 .include <bsd.prog.mk>