Makefile.inc0 revision 215276
150472Speter# $FreeBSD: head/gnu/usr.bin/binutils/Makefile.inc0 215276 2010-11-14 01:52:19Z imp $
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
7130575SobrienVERSION=	"2.15 [FreeBSD] 2004-05-23"
884947Sobrien
9215082Simp.if defined(TARGET_ARCH)
10215276SimpTARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
11130575Sobrien.else
12215082SimpTARGET_CPUARCH=${MACHINE_CPUARCH}
13130575Sobrien.endif
14215082SimpTARGET_ARCH?=	${MACHINE_ARCH}
15215082SimpBINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
16130575SobrienTARGET_TUPLE?=	${BINUTILS_ARCH}-obrien-freebsd
17215082Simp.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb"
18215082SimpTARGET_BIG_ENDIAN=t
19215082Simp.endif
2044360Simp
2133975Sjdp# RELTOP is the relative path to this point in the source or object
2233975Sjdp# tree, from any subdirectory of same.  It gets extra "../" prefixes
2333975Sjdp# added to it as we descend into subdirectories.
2484902SobrienRELTOP:= ..
2533975Sjdp
2684902SobrienRELSRC=	${RELTOP}/../../../contrib/binutils
2784902SobrienSRCDIR=	${.CURDIR}/${RELSRC}
2833975Sjdp
29215082Simp.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
30215276Simp	${TARGET_ARCH} == "powerpc" || \
31215082Simp	(${TARGET_CPUARCH} == "mips" && \
32215082Simp		(!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
33166638SmarcelCFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
34166638Smarcel.else
35166638SmarcelCFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
36166638Smarcel.endif
37166638Smarcel
3890353SobrienCFLAGS+= -I.
39215082Simp.if exists(${.CURDIR}/${TARGET_CPUARCH})
40215082SimpCFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH}
4134495Sjdp.endif
4284902SobrienCFLAGS+= -I${.CURDIR}
43131832SobrienCFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd
44130575SobrienCFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd
4584902SobrienCFLAGS+= -I${SRCDIR}/include
4634495Sjdp
47215082Simp.if exists(${.CURDIR}/${TARGET_CPUARCH})
48215082Simp.PATH: ${.CURDIR}/${TARGET_CPUARCH}
4934495Sjdp.endif
5034495Sjdp
51215082SimpARCHS=	${TARGET_CPUARCH}
5235709Sjb
5352927Sjb.for _arch in ${CROSS_ARCH}
5452927Sjb.if (${ARCHS:R:M${_arch:R}} == "")
5584902SobrienARCHS+= $(_arch)
5652927Sjb.endif
5752927Sjb.endfor
5852927Sjb
5935709Sjb.for _arch in ${ARCHS}
6035709Sjb.if exists(${.CURDIR}/Makefile.${_arch})
6135709Sjb.include "${.CURDIR}/Makefile.${_arch}"
6234495Sjdp.endif
6335709Sjb.endfor
64