]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/cc/Makefile.inc
Support armv7 builds for userland
[FreeBSD/FreeBSD.git] / gnu / usr.bin / cc / Makefile.inc
1 # $FreeBSD$
2
3 .include <src.opts.mk>
4 .include "../Makefile.inc"
5
6 # Sometimes this is .include'd several times...
7 .if !defined(__CC_MAKEFILE_INC__)
8 __CC_MAKEFILE_INC__= ${MFILE}
9
10 GCCVER= 4.2
11 GCCDIR= ${SRCTOP}/contrib/gcc
12 GCCLIB= ${SRCTOP}/contrib/gcclibs
13
14 .include "Makefile.tgt"
15
16 # Machine description.
17 MD_FILE=        ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
18 GCC_TARGET=     ${TARGET_ARCH}-undermydesk-freebsd
19
20 CFLAGS+=        -DGCCVER=\"${GCCVER}\"
21 CFLAGS+=        -DIN_GCC -DHAVE_CONFIG_H
22 CFLAGS+=        -DPREFIX=\"${TOOLS_PREFIX}/usr\"
23 #CFLAGS+=       -DWANT_COMPILER_INVARIANTS
24 CSTD?=  gnu89
25
26 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
27 CFLAGS+=        -DCROSS_DIRECTORY_STRUCTURE
28 .endif
29
30 .if ${TARGET_CPUARCH} == "arm"
31 CFLAGS+=        -DTARGET_ARM_EABI
32 .endif
33
34 .if ${TARGET_ARCH:Marm*eb} != ""
35 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
36 .endif
37 .if ${TARGET_ARCH:Marmv6*} != ""
38 CFLAGS += -DFREEBSD_ARCH_armv6
39 .endif
40 .if ${TARGET_ARCH:Marmv7*} != ""
41 CFLAGS += -DFREEBSD_ARCH_armv7
42 .endif
43
44 .if ${TARGET_CPUARCH} == "mips"
45 .if ${TARGET_ARCH:Mmips*el*} != ""
46 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
47 .endif
48
49 .if ${TARGET_ARCH:Mmips64*} != ""
50 MIPS_ABI_DEFAULT=ABI_64
51 .elif ${TARGET_ARCH:Mmipsn32*} != ""
52 MIPS_ABI_DEFAULT=ABI_N32
53 .else
54 MIPS_ABI_DEFAULT=ABI_32
55 .endif
56 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
57
58 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
59 # than taking the ISA from the ABI requirements, since FreeBSD is built with
60 # a number of MIPS-III features/instructions and that is the minimum ISA we
61 # support, not the O32 default MIPS-I.
62 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
63 TARGET_CPUTYPE?=mips3
64 .endif
65
66 # GCC by default takes the ISA from the ABI's requirements.  If world is built
67 # with a superior ISA, since we lack multilib, we have to set the right
68 # default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
69 .if defined(TARGET_CPUTYPE)
70 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
71 .endif
72 .endif
73
74 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
75 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
76 .endif
77
78 .if exists(${.OBJDIR}/../cc_tools)
79 CFLAGS+=        -I${.OBJDIR}/../cc_tools
80 .endif
81 CFLAGS+=        -I${.CURDIR}/../cc_tools
82 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
83 # correctly.
84 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config
85
86 CFLAGS+=        -I${GCCLIB}/include
87 CFLAGS+=        -I${GCCLIB}/libcpp/include
88 CFLAGS+=        -I${GCCLIB}/libdecnumber
89
90 .if exists(${.OBJDIR}/../cc_int)
91 LIBBACKEND=     ${.OBJDIR}/../cc_int/libbackend.a
92 .else
93 LIBBACKEND=     ${.CURDIR}/../cc_int/libbackend.a
94 .endif
95
96 .if exists(${.OBJDIR}/../libiberty)
97 LIBIBERTY=      ${.OBJDIR}/../libiberty/libiberty.a
98 .else
99 LIBIBERTY=      ${.CURDIR}/../libiberty/libiberty.a
100 .endif
101
102 .if exists(${.OBJDIR}/../libcpp)
103 LIBCPP=         ${.OBJDIR}/../libcpp/libcpp.a
104 .else
105 LIBCPP=         ${.CURDIR}/../libcpp/libcpp.a
106 .endif
107
108 .if exists(${.OBJDIR}/../libdecnumber)
109 LIBDECNUMBER=   ${.OBJDIR}/../libdecnumber/libdecnumber.a
110 .else
111 LIBDECNUMBER=   ${.CURDIR}/../libdecnumber/libdecnumber.a
112 .endif
113
114 .endif # !__CC_MAKEFILE_INC__