3 .include "../Makefile.inc"
5 # Sometimes this is .include'd several times...
6 .if !defined(__CC_MAKEFILE_INC__)
7 __CC_MAKEFILE_INC__= ${MFILE}
10 GCCDIR= ${.CURDIR}/../../../../contrib/gcc
11 GCCLIB= ${.CURDIR}/../../../../contrib/gcclibs
13 .include "Makefile.tgt"
15 # Machine description.
16 MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
17 GCC_TARGET= ${TARGET_ARCH}-undermydesk-freebsd
19 CFLAGS+= -DGCCVER=\"${GCCVER}\"
20 CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
21 CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"
22 #CFLAGS+= -DWANT_COMPILER_INVARIANTS
25 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
26 CFLAGS+= -DCROSS_COMPILE
29 .if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
30 CFLAGS+= -DTARGET_ARM_EABI
33 .if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb"
34 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
36 .if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb"
37 CFLAGS += -DFREEBSD_ARCH_armv6
40 .if ${TARGET_CPUARCH} == "mips"
41 .if ${TARGET_ARCH:Mmips*el} != ""
42 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
45 .if ${TARGET_ARCH:Mmips64*} != ""
46 MIPS_ABI_DEFAULT=ABI_64
47 .elif ${TARGET_ARCH:Mmipsn32*} != ""
48 MIPS_ABI_DEFAULT=ABI_N32
50 MIPS_ABI_DEFAULT=ABI_32
52 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
54 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
55 # than taking the ISA from the ABI requirements, since FreeBSD is built with
56 # a number of MIPS-III features/instructions and that is the minimum ISA we
57 # support, not the O32 default MIPS-I.
58 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
62 # GCC by default takes the ISA from the ABI's requirements. If world is built
63 # with a superior ISA, since we lack multilib, we have to set the right
64 # default ISA to be able to link against what's in /usr/lib. Terrible stuff.
65 .if defined(TARGET_CPUTYPE)
66 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
70 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
71 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
74 .if exists(${.OBJDIR}/../cc_tools)
75 CFLAGS+= -I${.OBJDIR}/../cc_tools
77 CFLAGS+= -I${.CURDIR}/../cc_tools
78 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
80 CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
82 CFLAGS+= -I${GCCLIB}/include
83 CFLAGS+= -I${GCCLIB}/libcpp/include
84 CFLAGS+= -I${GCCLIB}/libdecnumber
86 .if exists(${.OBJDIR}/../cc_int)
87 LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a
89 LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a
92 .if exists(${.OBJDIR}/../libiberty)
93 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
95 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
98 .if exists(${.OBJDIR}/../libcpp)
99 LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a
101 LIBCPP= ${.CURDIR}/../libcpp/libcpp.a
104 .if exists(${.OBJDIR}/../libdecnumber)
105 LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a
107 LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a
110 .endif # !__CC_MAKEFILE_INC__