binutils 2.20: Upgrade to version 2.20.1
[dragonfly.git] / gnu / usr.bin / binutils220 / libbfd / Makefile
CommitLineData
2ef93bd8
SS
1.include "../Makefile.inc0"
2
3LIB= bfd
4INTERNALLIB= true
5
6CONTRIBDIR= ${SRCDIR}/bfd
7.PATH: ${CONTRIBDIR}
8
9CFLAGS+= -I${SRCDIR}/include -I${CONTRIBDIR} -I${.CURDIR} -I${.OBJDIR}
10# XXX no clue what DEBUGDIR is for
11CFLAGS+= -DDEBUGDIR='"/usr/lib/debug"'
12
13SRCS= 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
20SRCS+= targmatch.h elf32-target.h elf64-target.h
21CLEANFILES+= elf64-target.h elf32-target.h targmatch.h
22
23targmatch.h: config.bfd targmatch.sed
24 sed -f ${CONTRIBDIR}/targmatch.sed < ${CONTRIBDIR}/config.bfd > ${.TARGET}
25
26elf32-target.h: elfxx-target.h
27 sed -e s/NN/32/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
28elf64-target.h: elfxx-target.h
29 sed -e s/NN/64/g < ${CONTRIBDIR}/elfxx-target.h > ${.TARGET}
30
31TARGET_ARCH?= ${MACHINE_ARCH}
32.include "Makefile.${TARGET_ARCH}"
33
187b297a 34_selvec=
2ef93bd8
SS
35.for _v in ${VECTORS}
36CFLAGS+= -DHAVE_${_v}
187b297a
SS
37.if !empty(_selvec)
38_selvec+= ,
39.endif
40_selvec+= &${_v}
2ef93bd8 41.endfor
187b297a
SS
42CFLAGS+= -DSELECT_VECS='${_selvec}'
43CFLAGS+= -DSELECT_ARCHITECTURES='${ARCHITECTURES:S/^/\&/:S/$/,/} 0'
2ef93bd8
SS
44CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
45
46
47SRCS+= bfd.h bfdver.h
48CLEANFILES+= bfd.h bfdver.h
49
50# Used to do keyword replacement in bfd-X.h
51#
52BFD_HOST_64_BIT_DEFINED?=1
53BFD_HOST_LONG_LONG?=1
54.include "Makefile.host.${MACHINE_ARCH}"
55
56bfd.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
70bfdver.h: ${CONTRIBDIR}/version.h
182ccc58 71 sed -e "s/@bfd_version_string@/\"2.20.1\"/g" \
2ef93bd8 72 -e "s/@bfd_version_package@/\"(GNU Binutils) \"/g" \
182ccc58 73 -e "s/@bfd_version@/220001000/g" \
2ef93bd8
SS
74 -e "s/@report_bugs_to@/\"\"/g" \
75 < ${CONTRIBDIR}/version.h > bfdver.h.new
76 mv -f bfdver.h.new bfdver.h
77
78SRCS+= bfd_stdint.h
79CLEANFILES+= bfd_stdint.h
80
81bfd_stdint.h:
82 touch ${.TARGET}
83
84.include <bsd.lib.mk>