]> CyberLeo.Net >> Repos - FreeBSD/releng/8.2.git/blob - gnu/usr.bin/cc/Makefile.inc
Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.
[FreeBSD/releng/8.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 GCCDIR= ${.CURDIR}/../../../../contrib/gcc
10 GCCLIB= ${.CURDIR}/../../../../contrib/gcclibs
11
12 .include "Makefile.tgt"
13
14 # Machine description.
15 MD_FILE=        ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
16 GCC_TARGET=     ${TARGET_ARCH}-undermydesk-freebsd
17
18 CFLAGS+=        -DIN_GCC -DHAVE_CONFIG_H
19 CFLAGS+=        -DPREFIX=\"${TOOLS_PREFIX}/usr\"
20 #CFLAGS+=       -DWANT_COMPILER_INVARIANTS
21 CSTD?=  gnu89
22
23 # If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined
24 # to get the proper sizes in limits.h
25 .if defined(LONG_TYPE_SIZE)
26 CFLAGS+=        -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
27 .endif
28
29 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
30 CFLAGS+=        -DCROSS_COMPILE
31 .endif
32
33 .if ${TARGET_ARCH} == "mips"
34 # XXX This is backwards, MIPS should default to BE.
35 .if !defined(TARGET_BIG_ENDIAN)
36 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
37 .endif
38
39 .if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
40 .if ${TARGET_ABI} == "n32"
41 MIPS_ABI_DEFAULT=ABI_N32
42 .elif ${TARGET_ABI} == "n64"
43 MIPS_ABI_DEFAULT=ABI_64
44 .endif
45 .endif
46
47 MIPS_ABI_DEFAULT?=ABI_32
48 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
49
50 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
51 # than taking the ISA from the ABI requirements, since FreeBSD is built with
52 # a number of MIPS-III features/instructions and that is the minimum ISA we
53 # support, not the O32 default MIPS-I.
54 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
55 TARGET_CPUTYPE?=mips3
56 .endif
57
58 # GCC by default takes the ISA from the ABI's requirements.  If world is built
59 # with a superior ISA, since we lack multilib, we have to set the right
60 # default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
61 .if defined(TARGET_CPUTYPE)
62 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
63 .endif
64 .endif
65
66 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
67 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
68 .endif
69
70 .if exists(${.OBJDIR}/../cc_tools)
71 CFLAGS+=        -I${.OBJDIR}/../cc_tools
72 .endif
73 CFLAGS+=        -I${.CURDIR}/../cc_tools
74 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
75 # correctly.
76 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config
77
78 CFLAGS+=        -I${GCCLIB}/include
79 CFLAGS+=        -I${GCCLIB}/libcpp/include
80 CFLAGS+=        -I${GCCLIB}/libdecnumber
81
82 .if exists(${.OBJDIR}/../cc_int)
83 LIBBACKEND=     ${.OBJDIR}/../cc_int/libbackend.a
84 .else
85 LIBBACKEND=     ${.CURDIR}/../cc_int/libbackend.a
86 .endif
87
88 .if exists(${.OBJDIR}/../libiberty)
89 LIBIBERTY=      ${.OBJDIR}/../libiberty/libiberty.a
90 .else
91 LIBIBERTY=      ${.CURDIR}/../libiberty/libiberty.a
92 .endif
93
94 .if exists(${.OBJDIR}/../libcpp)
95 LIBCPP=         ${.OBJDIR}/../libcpp/libcpp.a
96 .else
97 LIBCPP=         ${.CURDIR}/../libcpp/libcpp.a
98 .endif
99
100 .if exists(${.OBJDIR}/../libdecnumber)
101 LIBDECNUMBER=   ${.OBJDIR}/../libdecnumber/libdecnumber.a
102 .else
103 LIBDECNUMBER=   ${.CURDIR}/../libdecnumber/libdecnumber.a
104 .endif
105
106 .endif # !__CC_MAKEFILE_INC__