]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - gnu/usr.bin/cc/Makefile.inc
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.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_COMPILE
27 .endif
28
29 .if ${TARGET_ARCH} == "armeb"
30 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
31 .endif
32
33 .if ${TARGET_CPUARCH} == "mips"
34 .if ${TARGET_ARCH:Mmips*el} != ""
35 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
36 .endif
37
38 .if ${TARGET_ARCH:Mmips64*} != ""
39 MIPS_ABI_DEFAULT=ABI_64
40 .elif ${TARGET_ARCH:Mmipsn32*} != ""
41 MIPS_ABI_DEFAULT=ABI_N32
42 .else
43 MIPS_ABI_DEFAULT=ABI_32
44 .endif
45 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
46
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"
52 TARGET_CPUTYPE?=mips3
53 .endif
54
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}\"
60 .endif
61 .endif
62
63 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
64 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
65 .endif
66
67 .if exists(${.OBJDIR}/../cc_tools)
68 CFLAGS+=        -I${.OBJDIR}/../cc_tools
69 .endif
70 CFLAGS+=        -I${.CURDIR}/../cc_tools
71 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
72 # correctly.
73 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config
74
75 CFLAGS+=        -I${GCCLIB}/include
76 CFLAGS+=        -I${GCCLIB}/libcpp/include
77 CFLAGS+=        -I${GCCLIB}/libdecnumber
78
79 .if exists(${.OBJDIR}/../cc_int)
80 LIBBACKEND=     ${.OBJDIR}/../cc_int/libbackend.a
81 .else
82 LIBBACKEND=     ${.CURDIR}/../cc_int/libbackend.a
83 .endif
84
85 .if exists(${.OBJDIR}/../libiberty)
86 LIBIBERTY=      ${.OBJDIR}/../libiberty/libiberty.a
87 .else
88 LIBIBERTY=      ${.CURDIR}/../libiberty/libiberty.a
89 .endif
90
91 .if exists(${.OBJDIR}/../libcpp)
92 LIBCPP=         ${.OBJDIR}/../libcpp/libcpp.a
93 .else
94 LIBCPP=         ${.CURDIR}/../libcpp/libcpp.a
95 .endif
96
97 .if exists(${.OBJDIR}/../libdecnumber)
98 LIBDECNUMBER=   ${.OBJDIR}/../libdecnumber/libdecnumber.a
99 .else
100 LIBDECNUMBER=   ${.CURDIR}/../libdecnumber/libdecnumber.a
101 .endif
102
103 .endif # !__CC_MAKEFILE_INC__