Makefile revision 209867
1# $FreeBSD: head/gnu/usr.bin/binutils/libbfd/Makefile 209867 2010-07-10 02:29:22Z nwhitehorn $
2
3.include "../Makefile.inc0"
4
5.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
6
7LIB=	bfd
8SRCS+=	archive.c archive64.c archures.c bfd.c bfdwin.c binary.c cache.c \
9	coffgen.c corefile.c elf.c elf-eh-frame.c elf-strtab.c format.c \
10	hash.c ihex.c init.c libbfd.c linker.c merge.c opncls.c reloc.c \
11	section.c srec.c stab-syms.c stabs.c syms.c targets.c tekhex.c \
12	targmatch.h dwarf1.c dwarf2.c config.h bfdver.h bfdio.c simple.c
13WARNS?=	0
14.if (${TARGET_ARCH} == "ia64" || ${TARGET_ARCH} == "sparc64")
15WARNS?=	2
16.endif
17CFLAGS+= -D_GNU_SOURCE
18CFLAGS+= -I${SRCDIR}/bfd
19INTERNALLIB=
20CLEANFILES+=	bfdver.h config.h targmatch.h
21
22SELARCH=
23.if ${TARGET_ARCH} == "amd64"
24SELARCH= &bfd_i386_arch
25.elif ${TARGET_ARCH} == "sparc64"
26SELARCH= &bfd_sparc_arch
27.elif ${TARGET_ARCH} == "powerpc64"
28SELARCH= &bfd_powerpc_arch,&bfd_rs6000_arch
29.else
30.for _a in ${ARCHS}
31.if ${SELARCH} == ""
32SELARCH+= &bfd_${_a}_arch
33.else
34SELARCH+= ,&bfd_${_a}_arch
35.endif
36.endfor
37.endif
38CFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
39
40SELVEC=
41.for _v in ${VECS}
42CFLAGS+= -DHAVE_${_v}
43.if ${SELVEC} == ""
44SELVEC+= &${_v}
45.else
46SELVEC+= ,&${_v}
47.endif
48.endfor
49CFLAGS+= -DSELECT_VECS="${SELVEC}"
50CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
51
52# XXX:DEO should grab BFD_VERSION_DATE from ${VERSION}...
53bfdver.h: Makefile
54	echo '#define BFD_VERSION	215000000'	> ${.TARGET}
55	echo '#define BFD_VERSION_DATE	20040517'	>> ${.TARGET}
56	echo '#define BFD_VERSION_STRING ${VERSION}'	>> ${.TARGET}
57
58targmatch.h: targmatch.sed config.bfd
59	sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}
60
61config.h: config.h.fbsd
62.if ${TARGET_ARCH} == "i386"
63	sed -e 's,!!TRAD_HEADER!!,"hosts/i386bsd.h",g' ${.ALLSRC} > ${.TARGET}
64.else
65	sed -e 's,!!TRAD_HEADER!!,,g' ${.ALLSRC} > ${.TARGET}
66.endif
67
68CLEANFILES+=	elf32-target.h elf64-target.h
69elf32-target.h: elfxx-target.h
70	sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}
71
72elf64-target.h: elfxx-target.h
73	sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
74
75.include <bsd.lib.mk>
76