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_ARCH} == "armeb"
30 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
33 .if ${TARGET_CPUARCH} == "mips"
34 .if ${TARGET_ARCH:Mmips*el} != ""
35 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
38 .if ${TARGET_ARCH:Mmips64*} != ""
39 MIPS_ABI_DEFAULT=ABI_64
40 .elif ${TARGET_ARCH:Mmipsn32*} != ""
41 MIPS_ABI_DEFAULT=ABI_N32
43 MIPS_ABI_DEFAULT=ABI_32
45 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
47 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
48 # than taking the ISA from the ABI requirements, since FreeBSD is built with
49 # a number of MIPS-III features/instructions and that is the minimum ISA we
50 # support, not the O32 default MIPS-I.
51 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
55 # GCC by default takes the ISA from the ABI's requirements. If world is built
56 # with a superior ISA, since we lack multilib, we have to set the right
57 # default ISA to be able to link against what's in /usr/lib. Terrible stuff.
58 .if defined(TARGET_CPUTYPE)
59 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
63 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
64 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
67 .if exists(${.OBJDIR}/../cc_tools)
68 CFLAGS+= -I${.OBJDIR}/../cc_tools
70 CFLAGS+= -I${.CURDIR}/../cc_tools
71 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
73 CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config
75 CFLAGS+= -I${GCCLIB}/include
76 CFLAGS+= -I${GCCLIB}/libcpp/include
77 CFLAGS+= -I${GCCLIB}/libdecnumber
79 .if exists(${.OBJDIR}/../cc_int)
80 LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a
82 LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a
85 .if exists(${.OBJDIR}/../libiberty)
86 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
88 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
91 .if exists(${.OBJDIR}/../libcpp)
92 LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a
94 LIBCPP= ${.CURDIR}/../libcpp/libcpp.a
97 .if exists(${.OBJDIR}/../libdecnumber)
98 LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a
100 LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a
103 .endif # !__CC_MAKEFILE_INC__