150472Speter# $FreeBSD$
233975Sjdp#
333975Sjdp# This is included explicitly at the top of each sub-Makefile.  We can't
433975Sjdp# use the normal "Makefile.inc" mechanism, because we need some of these
533975Sjdp# definitions before the sub-Makefile is processed.
633975Sjdp
7218822SdimVERSION=	"2.17.50 [FreeBSD] 2007-07-03"
884947Sobrien
9215082Simp.if defined(TARGET_ARCH)
10239272SgonzoTARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
11130575Sobrien.else
12215082SimpTARGET_CPUARCH=${MACHINE_CPUARCH}
13130575Sobrien.endif
14215082SimpTARGET_ARCH?=	${MACHINE_ARCH}
15218822SdimTARGET_VENDOR?=	unknown
16218822SdimTARGET_OS?=	freebsd
17215082SimpBINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
18218822SdimTARGET_TUPLE?=	${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS}
19239272Sgonzo.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb" || \
20233644Sjmallett	(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el} == "")
21215082SimpTARGET_BIG_ENDIAN=t
22215082Simp.endif
2344360Simp
2433975Sjdp# RELTOP is the relative path to this point in the source or object
2533975Sjdp# tree, from any subdirectory of same.  It gets extra "../" prefixes
2633975Sjdp# added to it as we descend into subdirectories.
2784902SobrienRELTOP:= ..
2833975Sjdp
2984902SobrienRELSRC=	${RELTOP}/../../../contrib/binutils
3084902SobrienSRCDIR=	${.CURDIR}/${RELSRC}
3133975Sjdp
32215082Simp.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
33215276Simp	${TARGET_ARCH} == "powerpc" || \
34217942Sjchandra	(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "")
35166638SmarcelCFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
36166638Smarcel.else
37166638SmarcelCFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
38166638Smarcel.endif
39166638Smarcel
4090353SobrienCFLAGS+= -I.
4184902SobrienCFLAGS+= -I${.CURDIR}
42131832SobrienCFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd
43130575SobrienCFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd
4484902SobrienCFLAGS+= -I${SRCDIR}/include
4534495Sjdp
46215082SimpARCHS=	${TARGET_CPUARCH}
4735709Sjb
48215351Snwhitehorn.if exists(${.CURDIR}/Makefile.${TARGET_ARCH})
49215351Snwhitehorn.include "${.CURDIR}/Makefile.${TARGET_ARCH}"
50215351Snwhitehorn.elif exists(${.CURDIR}/Makefile.${TARGET_CPUARCH})
51215351Snwhitehorn.include "${.CURDIR}/Makefile.${TARGET_CPUARCH}"
5252927Sjb.endif
53