4 .include "../Makefile.inc"
6 # Sometimes this is .include'd several times...
7 .if !defined(__CC_MAKEFILE_INC__)
8 __CC_MAKEFILE_INC__= ${MFILE}
11 GCCDIR= ${.CURDIR}/../../../../contrib/gcc
12 GCCLIB= ${.CURDIR}/../../../../contrib/gcclibs
14 .include "Makefile.tgt"
16 # Machine description.
17 MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
18 GCC_TARGET= ${TARGET_ARCH}-undermydesk-freebsd
20 CFLAGS+= -DGCCVER=\"${GCCVER}\"
21 CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
22 CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"
23 #CFLAGS+= -DWANT_COMPILER_INVARIANTS
26 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
27 CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE
30 .if ${TARGET_CPUARCH} == "arm"
31 CFLAGS+= -DTARGET_ARM_EABI
34 .if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb"
35 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
37 .if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb"
38 CFLAGS += -DFREEBSD_ARCH_armv6
41 .if ${TARGET_CPUARCH} == "mips"
42 .if ${TARGET_ARCH:Mmips*el} != ""
43 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
46 .if ${TARGET_ARCH:Mmips64*} != ""
47 MIPS_ABI_DEFAULT=ABI_64
48 .elif ${TARGET_ARCH:Mmipsn32*} != ""
49 MIPS_ABI_DEFAULT=ABI_N32
51 MIPS_ABI_DEFAULT=ABI_32
53 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
55 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
56 # than taking the ISA from the ABI requirements, since FreeBSD is built with
57 # a number of MIPS-III features/instructions and that is the minimum ISA we
58 # support, not the O32 default MIPS-I.
59 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
63 # GCC by default takes the ISA from the ABI's requirements. If world is built
64 # with a superior ISA, since we lack multilib, we have to set the right
65 # default ISA to be able to link against what's in /usr/lib. Terrible stuff.
66 .if defined(TARGET_CPUTYPE)
67 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
71 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
72 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
75 .if exists(${.OBJDIR}/../cc_tools)
76 CFLAGS+= -I${.OBJDIR}/../cc_tools
78 CFLAGS+= -I${.CURDIR}/../cc_tools
79 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
81 CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
83 CFLAGS+= -I${GCCLIB}/include
84 CFLAGS+= -I${GCCLIB}/libcpp/include
85 CFLAGS+= -I${GCCLIB}/libdecnumber
87 .if exists(${.OBJDIR}/../cc_int)
88 LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a
90 LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a
93 .if exists(${.OBJDIR}/../libiberty)
94 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
96 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
99 .if exists(${.OBJDIR}/../libcpp)
100 LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a
102 LIBCPP= ${.CURDIR}/../libcpp/libcpp.a
105 .if exists(${.OBJDIR}/../libdecnumber)
106 LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a
108 LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a
111 .endif # !__CC_MAKEFILE_INC__