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= ${SRCTOP}/contrib/gcc
12 GCCLIB= ${SRCTOP}/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
28 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
31 .if ${TARGET_CPUARCH} == "arm"
32 CFLAGS+= -DTARGET_ARM_EABI
35 .if ${TARGET_ARCH:Marm*eb} != ""
36 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
38 .if ${TARGET_ARCH:Marmv6*} != ""
39 CFLAGS += -DFREEBSD_ARCH_armv6
41 .if ${TARGET_ARCH:Marmv7*} != ""
42 CFLAGS += -DFREEBSD_ARCH_armv7
45 .if ${TARGET_CPUARCH} == "mips"
46 .if ${TARGET_ARCH:Mmips*el*} != ""
47 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
50 .if ${TARGET_ARCH:Mmips64*} != ""
51 MIPS_ABI_DEFAULT=ABI_64
52 .elif ${TARGET_ARCH:Mmipsn32*} != ""
53 MIPS_ABI_DEFAULT=ABI_N32
55 MIPS_ABI_DEFAULT=ABI_32
57 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
59 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
60 # than taking the ISA from the ABI requirements, since FreeBSD is built with
61 # a number of MIPS-III features/instructions and that is the minimum ISA we
62 # support, not the O32 default MIPS-I.
63 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
67 # GCC by default takes the ISA from the ABI's requirements. If world is built
68 # with a superior ISA, since we lack multilib, we have to set the right
69 # default ISA to be able to link against what's in /usr/lib. Terrible stuff.
70 .if defined(TARGET_CPUTYPE)
71 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
75 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
76 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
79 .if exists(${.OBJDIR}/../cc_tools)
80 CFLAGS+= -I${.OBJDIR}/../cc_tools
82 CFLAGS+= -I${.CURDIR}/../cc_tools
83 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
85 CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
87 CFLAGS+= -I${GCCLIB}/include
88 CFLAGS+= -I${GCCLIB}/libcpp/include
89 CFLAGS+= -I${GCCLIB}/libdecnumber
91 .if exists(${.OBJDIR}/../cc_int)
92 LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a
94 LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a
97 .if exists(${.OBJDIR}/../libiberty)
98 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
100 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
103 .if exists(${.OBJDIR}/../libcpp)
104 LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a
106 LIBCPP= ${.CURDIR}/../libcpp/libcpp.a
109 .if exists(${.OBJDIR}/../libdecnumber)
110 LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a
112 LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a
115 .endif # !__CC_MAKEFILE_INC__