Makefile revision 256281
119102Sse# $FreeBSD: stable/10/gnu/usr.bin/binutils/libbfd/Makefile 218822 2011-02-18 20:54:12Z dim $
219102Sse
319102Sse.include "../Makefile.inc0"
419102Sse
519102Sse.PATH: ${SRCDIR}/bfd ${SRCDIR}/opcodes
619102Sse
719102SseLIB=	bfd
819102SseSRCS+=	archive.c \
919102Sse	archive64.c \
1019102Sse	archures.c \
1119102Sse	bfd.c \
1219102Sse	bfdio.c \
1319102Sse	bfdver.h \
1419102Sse	bfdwin.c \
15149223Sdes	binary.c \
1619102Sse	cache.c \
1719102Sse	coffgen.c \
1819102Sse	config.h \
1919102Sse	corefile.c \
2019102Sse	dwarf1.c \
2119102Sse	dwarf2.c \
2219102Sse	elf-attrs.c \
2319102Sse	elf-eh-frame.c \
2419102Sse	elf-strtab.c \
2519102Sse	elf-vxworks.c \
2619102Sse	elf.c \
2719102Sse	format.c \
2819102Sse	hash.c \
2919102Sse	ihex.c \
3030172Scharnier	init.c \
3130172Scharnier	libbfd.c \
3250479Speter	linker.c \
3330172Scharnier	merge.c \
3430172Scharnier	opncls.c \
3519102Sse	reloc.c \
3619102Sse	section.c \
3719102Sse	simple.c \
38166435Sjhb	srec.c \
3919102Sse	stab-syms.c \
4019102Sse	stabs.c \
4119102Sse	syms.c \
4219102Sse	targets.c \
4319102Sse	targmatch.h \
4454322Sken	tekhex.c
4569700Smsmith.if (${TARGET_ARCH} == "ia64" || ${TARGET_ARCH} == "sparc64")
4619102SseWARNS?=	2
4769785Smsmith.endif
4869700SmsmithCFLAGS+= -D_GNU_SOURCE
4919102SseCFLAGS+= -I${SRCDIR}/bfd
50166435SjhbINTERNALLIB=
5119102SseCLEANFILES+=	bfdver.h config.h targmatch.h
52149223Sdes
5369700SmsmithSELARCH=
5469700Smsmith.if ${TARGET_ARCH} == "amd64"
5569700SmsmithSELARCH= &bfd_i386_arch
5669700Smsmith.elif ${TARGET_ARCH} == "sparc64"
5769700SmsmithSELARCH= &bfd_sparc_arch
5869700Smsmith.else
5969700Smsmith.for _a in ${ARCHS}
6069700Smsmith.if ${SELARCH} == ""
6169700SmsmithSELARCH+= &bfd_${_a}_arch
6269700Smsmith.else
6369700SmsmithSELARCH+= ,&bfd_${_a}_arch
6469700Smsmith.endif
6569700Smsmith.endfor
6669700Smsmith.endif
6769700SmsmithCFLAGS+= -DSELECT_ARCHITECTURES="${SELARCH}"
6869700Smsmith
69166435SjhbSELVEC=
7069700Smsmith.for _v in ${VECS}
71166435SjhbCFLAGS+= -DHAVE_${_v}
72166435Sjhb.if ${SELVEC} == ""
7369700SmsmithSELVEC+= &${_v}
7419102Sse.else
7519102SseSELVEC+= ,&${_v}
7621935Sse.endif
7719102Sse.endfor
7850225SpeterCFLAGS+= -DSELECT_VECS="${SELVEC}"
7919102SseCFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR}
8019102SseCFLAGS+= -DDEBUGDIR="NULL"
81166435Sjhb
8230172Scharnier# XXX:DEO should grab BFD_VERSION_DATE from ${VERSION}...
8330172Scharnierbfdver.h: Makefile
84166435Sjhb	echo '#define BFD_VERSION	217500000'	> ${.TARGET}
85103499Sjdp	echo '#define BFD_VERSION_DATE	20070703'	>> ${.TARGET}
86103499Sjdp	echo '#define BFD_VERSION_STRING ${VERSION}'	>> ${.TARGET}
87103499Sjdp	echo '#define REPORT_BUGS_TO "<http://www.freebsd.org/send-pr.html>"' >> ${.TARGET}
8819817Sse
8919102Ssetargmatch.h: targmatch.sed config.bfd
9019102Sse	sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}
9119102Sse
9219102Sseconfig.h: config.h.fbsd
9319102Sse.if ${TARGET_ARCH} == "i386"
9419102Sse	sed -e 's,!!TRAD_HEADER!!,"hosts/i386bsd.h",g' ${.ALLSRC} > ${.TARGET}
95166435Sjhb.else
9619102Sse	sed -e 's,!!TRAD_HEADER!!,,g' ${.ALLSRC} > ${.TARGET}
9719102Sse.endif
98166435Sjhb
9919102SseCLEANFILES+=	elf32-target.h elf64-target.h
100182707Simpelf32-target.h: elfxx-target.h
10119102Sse	sed -e s/NN/32/g ${.ALLSRC} > ${.TARGET}
10221935Sse
10321935Sseelf64-target.h: elfxx-target.h
10421935Sse	sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
10521935Sse
106182707Simp.include <bsd.lib.mk>
107182707Simp