Makefile.inc0 revision 215276
1# $FreeBSD: head/gnu/usr.bin/binutils/Makefile.inc0 215276 2010-11-14 01:52:19Z imp $
2#
3# This is included explicitly at the top of each sub-Makefile.  We can't
4# use the normal "Makefile.inc" mechanism, because we need some of these
5# definitions before the sub-Makefile is processed.
6
7VERSION=	"2.15 [FreeBSD] 2004-05-23"
8
9.if defined(TARGET_ARCH)
10TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
11.else
12TARGET_CPUARCH=${MACHINE_CPUARCH}
13.endif
14TARGET_ARCH?=	${MACHINE_ARCH}
15BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
16TARGET_TUPLE?=	${BINUTILS_ARCH}-obrien-freebsd
17.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb"
18TARGET_BIG_ENDIAN=t
19.endif
20
21# RELTOP is the relative path to this point in the source or object
22# tree, from any subdirectory of same.  It gets extra "../" prefixes
23# added to it as we descend into subdirectories.
24RELTOP:= ..
25
26RELSRC=	${RELTOP}/../../../contrib/binutils
27SRCDIR=	${.CURDIR}/${RELSRC}
28
29.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
30	${TARGET_ARCH} == "powerpc" || \
31	(${TARGET_CPUARCH} == "mips" && \
32		(!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
33CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
34.else
35CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
36.endif
37
38CFLAGS+= -I.
39.if exists(${.CURDIR}/${TARGET_CPUARCH})
40CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH}
41.endif
42CFLAGS+= -I${.CURDIR}
43CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd
44CFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd
45CFLAGS+= -I${SRCDIR}/include
46
47.if exists(${.CURDIR}/${TARGET_CPUARCH})
48.PATH: ${.CURDIR}/${TARGET_CPUARCH}
49.endif
50
51ARCHS=	${TARGET_CPUARCH}
52
53.for _arch in ${CROSS_ARCH}
54.if (${ARCHS:R:M${_arch:R}} == "")
55ARCHS+= $(_arch)
56.endif
57.endfor
58
59.for _arch in ${ARCHS}
60.if exists(${.CURDIR}/Makefile.${_arch})
61.include "${.CURDIR}/Makefile.${_arch}"
62.endif
63.endfor
64