binutils214 stage 1/4. Bring in the build infrastructure (left untied from
[dragonfly.git] / gnu / usr.bin / binutils214 / 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/binutils214/ld/Attic/Makefile,v 1.1 2004/02/01 08:53:04 dillon Exp $
3
4 .include "../Makefile.inc0"
5
6 .PATH: ${SRCDIR}/ld
7
8 PROG=   ld
9 SCRIPTDIR= /usr/libexec/binutils214/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/libexec/binutils214\"
24 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
25 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
26 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}/usr/libexec/binutils214\"
27 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/usr/libexec/binutils214\"
28 NOSHARED?= yes
29 DPADD=  ${RELTOP}/libbfd/libbfd.a
30 DPADD+= ${RELTOP}/libiberty/libiberty.a
31 LDADD=  ${DPADD}
32 CLEANDIRS+=     ldscripts
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>