rename amd64 architecture to x86_64
[dragonfly.git] / gnu / usr.bin / binutils217 / libbfd / Makefile
CommitLineData
a968ac75
SS
1# $DragonFly: src/gnu/usr.bin/binutils217/libbfd/Makefile,v 1.1 2007/04/13 12:24:32 corecode Exp $
2
3.include "../Makefile.inc0"
4
5.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
6
7CONTRIBDIR= ${SRCDIR}/bfd
8
9LIB= bfd
10SRCS+= archive.c archive64.c archures.c bfd.c bfdio.c binary.c cache.c \
11 coffgen.c corefile.c elf.c elf-eh-frame.c elf-strtab.c format.c \
12 hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c reloc.c \
13 section.c simple.c srec.c stab-syms.c stabs.c syms.c \
14 targets.c tekhex.c \
15 targmatch.h dwarf1.c dwarf2.c config.h bfd.h bfdver.h
16.if (${TARGET_ARCH} == "alpha" || ${TARGET_ARCH} == "sparc64")
17WARNS= 2
18.endif
19CFLAGS+= -I${SRCDIR}/bfd
20INTERNALLIB= true
21
22CLEANFILES+= bfd.h bfdver.h targmatch.h
23
24# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
25# binutils release. FreeBSD only distributes the bits that are required to
26# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
27.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
28.PATH: ${BINUTILSDISTDIR}/bfd ${BINUTILSDISTDIR}/opcodes
29CFLAGS+= -I${BINUTILSDISTDIR}/bfd -I${BINUTILSDISTDIR}/include -I.
30.endif
31
32# XXX broken
33SELARCH=
c1543a89 34.if ${BINUTIL_ARCH} == "x86_64"
a968ac75
SS
35SELARCH= &bfd_i386_arch
36.else
37.for _a in ${ARCHS}
38.if ${SELARCH} == ""
39SELARCH+= &bfd_${_a}_arch
40.else
41SELARCH+= ,&bfd_${_a}_arch
42.endif
43.endfor
44.endif
45CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
46
47SELVEC=
48.for _v in ${VECS}
49CFLAGS+= -DHAVE_${_v}
50.if ${SELVEC} == ""
51SELVEC+= &${_v}
52.else
53SELVEC+= ,&${_v}
54.endif
55.endfor
56.if defined(DEFAULT_VECTOR)
57CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
58.endif
59CFLAGS+= -DSELECT_VECS="${SELVEC}"
60
61# Used to do keyword replacement in bfd-X.h
62#
63.if ${MACHINE_ARCH} == "i386"
64BFD_HOST_64BIT_LONG?=0
65BFD_HOST_64_BIT?=long long
66BFD_HOST_U_64_BIT?=unsigned long long
67.else
68BFD_HOST_64BIT_LONG?=1
69BFD_HOST_64_BIT?=long long
70BFD_HOST_U_64_BIT?=unsigned long long
71.endif
72BFD_HOST_64_BIT_DEFINED?=1
73BFD_HOST_LONG_LONG?=1
74
75bfd.h: ${SRCDIR}/bfd/bfd-in2.h
76 sed -e "s/@wordsize@/${BFD_ARCH_SIZE}/g" \
77 -e "s/@bfd_default_target_size@/${BFD_DEFAULT_TARGET_SIZE}/g" \
78 -e "s/@BFD_HOST_64BIT_LONG@/${BFD_HOST_64BIT_LONG}/g" \
79 -e "s/@BFD_HOST_64_BIT@/${BFD_HOST_64_BIT}/g" \
80 -e "s/@BFD_HOST_U_64_BIT@/${BFD_HOST_U_64_BIT}/g" \
81 -e "s/@BFD_HOST_64_BIT_DEFINED@/${BFD_HOST_64_BIT_DEFINED}/g" \
82 -e "s/@BFD_HOST_LONG_LONG@/${BFD_HOST_LONG_LONG}/g" \
83 -e "s/@bfd_file_ptr@/${BFD_HOST_64_BIT}/g" \
84 < ${SRCDIR}/bfd/bfd-in2.h > bfd.h.new
85 mv -f bfd.h.new bfd.h
86
87bfdver.h: ${SRCDIR}/bfd/version.h
88 sed -e "s/@bfd_version_string@/\\\"`echo -n ${VERSION}`\\\"/g" \
89 -e "s/@bfd_version@/${VERSION_BFD}/g" \
90 < ${SRCDIR}/bfd/version.h > bfdver.h.new
91 mv -f bfdver.h.new bfdver.h
92
93# match targets defined in the assembler's targ-env.h with an output vector.
c1543a89 94# XXX i386-*-dragonfly and x86_64-*-dragonfly are obsolete, but not quite
a968ac75
SS
95# removed from the binutils build yet.
96targmatch.h: targmatch.sed config.bfd
97 sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}.new
98 echo ${TARGMATCH:Q} >> ${.TARGET}.new
99 mv -f ${.TARGET}.new ${.TARGET}
100
101.include <bsd.lib.mk>