binutils214 stage 2/4.
[dragonfly.git] / gnu / usr.bin / binutils214 / libbfd / Makefile
CommitLineData
964aa826 1# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile,v 1.9.2.3 2002/09/01 23:39:15 obrien Exp $
17030342 2# $DragonFly: src/gnu/usr.bin/binutils214/libbfd/Attic/Makefile,v 1.2 2004/02/02 05:43:11 dillon Exp $
964aa826
MD
3
4.include "../Makefile.inc0"
5
6.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
7
8LIB= bfd
9SRCS+= archive.c archive64.c archures.c bfd.c bfdio.c binary.c cache.c \
10 coffgen.c corefile.c elf.c elf-eh-frame.c elf-strtab.c format.c \
11 hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c reloc.c \
12 section.c simple.c srec.c stab-syms.c stabs.c syms.c \
13 targets.c tekhex.c \
14 targmatch.h dwarf1.c dwarf2.c config.h bfd.h bfdver.h
15.if (${TARGET_ARCH} == "alpha" || ${TARGET_ARCH} == "sparc64")
16WARNS= 2
17.endif
18CFLAGS+= -I${SRCDIR}/bfd
19INTERNALLIB= true
20CLEANFILES+= bfd.h bfdver.h config.h targmatch.h
21
22# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
23# binutils release. FreeBSD only distributes the bits that are required to
24# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
25.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
26.PATH: ${BINUTILSDISTDIR}/bfd ${BINUTILSDISTDIR}/opcodes
27CFLAGS+= -I${BINUTILSDISTDIR}/bfd -I${BINUTILSDISTDIR}/include -I.
28.endif
29
30SELARCH=
17030342
MD
31.if ${BINUTIL_ARCH} == "amd64"
32SELARCH= &bfd_i386_arch
964aa826
MD
33.else
34.for _a in ${ARCHS}
35.if ${SELARCH} == ""
36SELARCH+= &bfd_${_a}_arch
37.else
38SELARCH+= ,&bfd_${_a}_arch
39.endif
40.endfor
41.endif
42CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
43
44SELVEC=
45.for _v in ${VECS}
46.if ${SELVEC} == ""
47SELVEC+= &${_v}
48.else
49SELVEC+= ,&${_v}
50.endif
51.endfor
52CFLAGS+= -DSELECT_VECS="${SELVEC}"
53
54# Used to do keyword replacement in bfd-X.h
55#
56BFD_ARCH_SIZE?=64
57BFD_DEFAULT_TARGET_SIZE?=64
58.if ${MACHINE_ARCH} == "i386"
59BFD_HOST_64BIT_LONG?=0
60.else
61BFD_HOST_64BIT_LONG?=1
62.endif
63BFD_HOST_64_BIT_DEFINED?=0
64
65bfd.h: ${SRCDIR}/bfd/bfd-in2.h
66 sed -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
67 -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
68 -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
69 -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
70 -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
71 -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
72 < ${SRCDIR}/bfd/bfd-in2.h > bfd.h.new
73 mv -f bfd.h.new bfd.h
74
75bfdver.h: ${SRCDIR}/bfd/version.h
76 sed -e "s/@bfd_version_string@/\\\"`echo -n ${VERSION}`\\\"/g" \
77 -e "s/@bfd_version@/${VERSION_DATE}/g" \
78 < ${SRCDIR}/bfd/version.h > bfdver.h.new
79 mv -f bfdver.h.new bfdver.h
80
81targmatch.h: targmatch.sed config.bfd dfly_targmatch.h
82 sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}.new
83 cat ${.CURDIR}/dfly_targmatch.h >> ${.TARGET}.new
84 mv -f ${.TARGET}.new ${.TARGET}
85
86config.h: config.h.template
87.if ${BINUTIL_ARCH} == "i386"
88 sed -e 's,!!TRAD_HEADER!!,"hosts/i386bsd.h",g' ${.ALLSRC} > ${.TARGET}
89.else
90 sed -e 's,!!TRAD_HEADER!!,,g' ${.ALLSRC} > ${.TARGET}
91.endif
92
93.include <bsd.lib.mk>