binutils 2.22: Add makefiles, new incremental-dump binary
[dragonfly.git] / gnu / usr.bin / binutils222 / ld / Makefile
1 ELF_SCR_EXT=    x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/ld
6
7 PROG=   ld.bfd
8 MAN=    ld222.1
9 MLINKS+=ld222.1 ld.1
10 LIBEXEC_BINUTILS= ${BINDIR}/..
11 SCRIPTDIR= ${LIBEXEC_BINUTILS}/ldscripts
12 SRCS+=  ldgram.y        \
13         ldlex.l         \
14         lexsup.c        \
15         ldlang.c        \
16         mri.c           \
17         ldctor.c        \
18         ldmain.c        \
19         ldwrite.c       \
20         ldexp.c         \
21         ldemul.c        \
22         ldver.c         \
23         ldmisc.c        \
24         ldfile.c        \
25         ldcref.c
26
27 SRCS+=  ldemul-list.h
28
29 WARNS=  1
30 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
31 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
32 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
33 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
34 NOSHARED?= yes
35
36 CLEANDIRS+=     ldscripts tmpdir
37 CLEANFILES+=    ldemul-list.h stringify.sed
38
39 LINKS= ${BINDIR}/ld.bfd ${BINDIR}/ld
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 ld222.1: ${SRCDIR}/ld/ld.1
56         cp ${.ALLSRC} ${.TARGET}
57
58 CLEANFILES+=    ld222.1
59
60 afterinstall: install-ldscripts
61
62 install-ldscripts: ${LDSCRIPTS:S|^|ldscripts/|}
63         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
64              ${.ALLSRC} ${DESTDIR}${SCRIPTDIR}
65
66 .include <bsd.prog.mk>