]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - gnu/usr.bin/cc/Makefile.inc
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / gnu / usr.bin / cc / Makefile.inc
1 # $FreeBSD$
2
3 .include "../Makefile.inc"
4
5 # Sometimes this is .include'd several times...
6 .if !defined(__CC_MAKEFILE_INC__)
7 __CC_MAKEFILE_INC__= ${MFILE}
8
9 GCCVER= 4.2
10 GCCDIR= ${.CURDIR}/../../../../contrib/gcc
11 GCCLIB= ${.CURDIR}/../../../../contrib/gcclibs
12
13 .include "Makefile.tgt"
14
15 # Machine description.
16 MD_FILE=        ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
17 GCC_TARGET=     ${TARGET_ARCH}-undermydesk-freebsd
18
19 CFLAGS+=        -DGCCVER=\"${GCCVER}\"
20 CFLAGS+=        -DIN_GCC -DHAVE_CONFIG_H
21 CFLAGS+=        -DPREFIX=\"${TOOLS_PREFIX}/usr\"
22 #CFLAGS+=       -DWANT_COMPILER_INVARIANTS
23 CSTD?=  gnu89
24
25 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
26 CFLAGS+=        -DCROSS_DIRECTORY_STRUCTURE
27 .endif
28
29 .if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
30 CFLAGS+=        -DTARGET_ARM_EABI
31 .endif
32
33 .if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb"
34 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
35 .endif
36 .if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb"
37 CFLAGS += -DFREEBSD_ARCH_armv6
38 .endif
39
40 .if ${TARGET_CPUARCH} == "mips"
41 .if ${TARGET_ARCH:Mmips*el} != ""
42 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
43 .endif
44
45 .if ${TARGET_ARCH:Mmips64*} != ""
46 MIPS_ABI_DEFAULT=ABI_64
47 .elif ${TARGET_ARCH:Mmipsn32*} != ""
48 MIPS_ABI_DEFAULT=ABI_N32
49 .else
50 MIPS_ABI_DEFAULT=ABI_32
51 .endif
52 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
53
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"
59 TARGET_CPUTYPE?=mips3
60 .endif
61
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}\"
67 .endif
68 .endif
69
70 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
71 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
72 .endif
73
74 .if exists(${.OBJDIR}/../cc_tools)
75 CFLAGS+=        -I${.OBJDIR}/../cc_tools
76 .endif
77 CFLAGS+=        -I${.CURDIR}/../cc_tools
78 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
79 # correctly.
80 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config
81
82 CFLAGS+=        -I${GCCLIB}/include
83 CFLAGS+=        -I${GCCLIB}/libcpp/include
84 CFLAGS+=        -I${GCCLIB}/libdecnumber
85
86 .if exists(${.OBJDIR}/../cc_int)
87 LIBBACKEND=     ${.OBJDIR}/../cc_int/libbackend.a
88 .else
89 LIBBACKEND=     ${.CURDIR}/../cc_int/libbackend.a
90 .endif
91
92 .if exists(${.OBJDIR}/../libiberty)
93 LIBIBERTY=      ${.OBJDIR}/../libiberty/libiberty.a
94 .else
95 LIBIBERTY=      ${.CURDIR}/../libiberty/libiberty.a
96 .endif
97
98 .if exists(${.OBJDIR}/../libcpp)
99 LIBCPP=         ${.OBJDIR}/../libcpp/libcpp.a
100 .else
101 LIBCPP=         ${.CURDIR}/../libcpp/libcpp.a
102 .endif
103
104 .if exists(${.OBJDIR}/../libdecnumber)
105 LIBDECNUMBER=   ${.OBJDIR}/../libdecnumber/libdecnumber.a
106 .else
107 LIBDECNUMBER=   ${.CURDIR}/../libdecnumber/libdecnumber.a
108 .endif
109
110 .endif # !__CC_MAKEFILE_INC__