binutils 2.20: Upgrade to version 2.20.1
[dragonfly.git] / gnu / usr.bin / binutils220 / libbfd / Makefile
1 .include "../Makefile.inc0"
2
3 LIB=    bfd
4 INTERNALLIB=    true
5
6 CONTRIBDIR=     ${SRCDIR}/bfd
7 .PATH:  ${CONTRIBDIR}
8
9 CFLAGS+=        -I${SRCDIR}/include -I${CONTRIBDIR} -I${.CURDIR} -I${.OBJDIR}
10 # XXX no clue what DEBUGDIR is for
11 CFLAGS+=        -DDEBUGDIR='"/usr/lib/debug"'
12
13 SRCS=   archive.c archures.c bfd.c bfdio.c bfdwin.c \
14         cache.c coffgen.c corefile.c format.c init.c libbfd.c \
15         opncls.c reloc.c section.c syms.c targets.c hash.c \
16         linker.c srec.c binary.c tekhex.c ihex.c stabs.c \
17         stab-syms.c merge.c dwarf2.c simple.c compress.c \
18         verilog.c
19
20 SRCS+=          targmatch.h elf32-target.h elf64-target.h
21 CLEANFILES+=    elf64-target.h elf32-target.h targmatch.h
22
23 targmatch.h: config.bfd targmatch.sed
24         sed -f ${CONTRIBDIR}/targmatch.sed < ${CONTRIBDIR}/config.bfd > ${.TARGET}
25
26 elf32-target.h: elfxx-target.h
27         sed -e s/NN/32/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
28 elf64-target.h: elfxx-target.h
29         sed -e s/NN/64/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
30
31 TARGET_ARCH?=   ${MACHINE_ARCH}
32 .include "Makefile.${TARGET_ARCH}"
33
34 _selvec=
35 .for _v in ${VECTORS}
36 CFLAGS+= -DHAVE_${_v}
37 .if !empty(_selvec)
38 _selvec+= ,
39 .endif
40 _selvec+= &${_v}
41 .endfor
42 CFLAGS+= -DSELECT_VECS='${_selvec}'
43 CFLAGS+= -DSELECT_ARCHITECTURES='${ARCHITECTURES:S/^/\&/:S/$/,/} 0'
44 CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
45
46
47 SRCS+=          bfd.h bfdver.h
48 CLEANFILES+=    bfd.h bfdver.h
49
50 # Used to do keyword replacement in bfd-X.h
51 #
52 BFD_HOST_64_BIT_DEFINED?=1
53 BFD_HOST_LONG_LONG?=1
54 .include "Makefile.host.${MACHINE_ARCH}"
55
56 bfd.h:  ${CONTRIBDIR}/bfd-in2.h
57         sed -e "s/@supports_plugins@/0/g" \
58             -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
59             -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
60             -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
61             -e "s/@BFD_HOST_64BIT_LONG_LONG@/${BFD_HOST_64BIT_LONG_LONG}/g" \
62             -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
63             -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
64             -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
65             -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \
66             -e "s/@BFD_HOSTPTR_T@/${BFD_HOSTPTR_T}/g" \
67             < ${CONTRIBDIR}/bfd-in2.h > bfd.h.new
68         mv -f bfd.h.new bfd.h
69
70 bfdver.h: ${CONTRIBDIR}/version.h
71         sed -e "s/@bfd_version_string@/\"2.20.1\"/g" \
72             -e "s/@bfd_version_package@/\"(GNU Binutils) \"/g" \
73             -e "s/@bfd_version@/220001000/g" \
74             -e "s/@report_bugs_to@/\"\"/g" \
75             < ${CONTRIBDIR}/version.h > bfdver.h.new
76         mv -f bfdver.h.new bfdver.h
77
78 SRCS+=          bfd_stdint.h
79 CLEANFILES+=    bfd_stdint.h
80
81 bfd_stdint.h:
82         touch ${.TARGET}
83
84 .include <bsd.lib.mk>