3 .include "../Makefile.inc"
5 # Sometimes this is .include'd several times...
6 .if !defined(__CC_MAKEFILE_INC__)
7 __CC_MAKEFILE_INC__= ${MFILE}
9 GCCDIR= ${.CURDIR}/../../../../contrib/gcc
10 GCCLIB= ${.CURDIR}/../../../../contrib/gcclibs
12 .include "Makefile.tgt"
14 # Machine description.
15 MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
16 GCC_TARGET= ${TARGET_ARCH}-undermydesk-freebsd
18 CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
19 CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"
20 #CFLAGS+= -DWANT_COMPILER_INVARIANTS
23 # If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined
24 # to get the proper sizes in limits.h
25 .if defined(LONG_TYPE_SIZE)
26 CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
29 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
30 CFLAGS+= -DCROSS_COMPILE
33 .if ${TARGET_ARCH} == "mips"
34 # XXX This is backwards, MIPS should default to BE.
35 .if !defined(TARGET_BIG_ENDIAN)
36 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
39 .if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
40 .if ${TARGET_ABI} == "n32"
41 MIPS_ABI_DEFAULT=ABI_N32
42 .elif ${TARGET_ABI} == "n64"
43 MIPS_ABI_DEFAULT=ABI_64
47 MIPS_ABI_DEFAULT?=ABI_32
48 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
50 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
51 # than taking the ISA from the ABI requirements, since FreeBSD is built with
52 # a number of MIPS-III features/instructions and that is the minimum ISA we
53 # support, not the O32 default MIPS-I.
54 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
58 # GCC by default takes the ISA from the ABI's requirements. If world is built
59 # with a superior ISA, since we lack multilib, we have to set the right
60 # default ISA to be able to link against what's in /usr/lib. Terrible stuff.
61 .if defined(TARGET_CPUTYPE)
62 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
66 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
67 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
70 .if exists(${.OBJDIR}/../cc_tools)
71 CFLAGS+= -I${.OBJDIR}/../cc_tools
73 CFLAGS+= -I${.CURDIR}/../cc_tools
74 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
76 CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
78 CFLAGS+= -I${GCCLIB}/include
79 CFLAGS+= -I${GCCLIB}/libcpp/include
80 CFLAGS+= -I${GCCLIB}/libdecnumber
82 .if exists(${.OBJDIR}/../cc_int)
83 LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a
85 LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a
88 .if exists(${.OBJDIR}/../libiberty)
89 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
91 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
94 .if exists(${.OBJDIR}/../libcpp)
95 LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a
97 LIBCPP= ${.CURDIR}/../libcpp/libcpp.a
100 .if exists(${.OBJDIR}/../libdecnumber)
101 LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a
103 LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a
106 .endif # !__CC_MAKEFILE_INC__