]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/cc/Makefile.inc
Update mandoc to 1.13.4 release
[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= ${.CURDIR}/../../../../contrib/gcc
12 GCCLIB= ${.CURDIR}/../../../../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} == "armeb" || ${TARGET_ARCH} == "armv6eb"
35 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
36 .endif
37 .if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb"
38 CFLAGS += -DFREEBSD_ARCH_armv6
39 .endif
40
41 .if ${TARGET_CPUARCH} == "mips"
42 .if ${TARGET_ARCH:Mmips*el} != ""
43 CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
44 .endif
45
46 .if ${TARGET_ARCH:Mmips64*} != ""
47 MIPS_ABI_DEFAULT=ABI_64
48 .elif ${TARGET_ARCH:Mmipsn32*} != ""
49 MIPS_ABI_DEFAULT=ABI_N32
50 .else
51 MIPS_ABI_DEFAULT=ABI_32
52 .endif
53 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
54
55 # If we are compiling for the O32 ABI, we need to default to MIPS-III rather
56 # than taking the ISA from the ABI requirements, since FreeBSD is built with
57 # a number of MIPS-III features/instructions and that is the minimum ISA we
58 # support, not the O32 default MIPS-I.
59 .if ${MIPS_ABI_DEFAULT} == "ABI_32"
60 TARGET_CPUTYPE?=mips3
61 .endif
62
63 # GCC by default takes the ISA from the ABI's requirements.  If world is built
64 # with a superior ISA, since we lack multilib, we have to set the right
65 # default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
66 .if defined(TARGET_CPUTYPE)
67 CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
68 .endif
69 .endif
70
71 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
72 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
73 .endif
74
75 .if exists(${.OBJDIR}/../cc_tools)
76 CFLAGS+=        -I${.OBJDIR}/../cc_tools
77 .endif
78 CFLAGS+=        -I${.CURDIR}/../cc_tools
79 # This must go after the -I for cc_tools to resolve ambiguities for hash.h
80 # correctly.
81 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config
82
83 CFLAGS+=        -I${GCCLIB}/include
84 CFLAGS+=        -I${GCCLIB}/libcpp/include
85 CFLAGS+=        -I${GCCLIB}/libdecnumber
86
87 .if exists(${.OBJDIR}/../cc_int)
88 LIBBACKEND=     ${.OBJDIR}/../cc_int/libbackend.a
89 .else
90 LIBBACKEND=     ${.CURDIR}/../cc_int/libbackend.a
91 .endif
92
93 .if exists(${.OBJDIR}/../libiberty)
94 LIBIBERTY=      ${.OBJDIR}/../libiberty/libiberty.a
95 .else
96 LIBIBERTY=      ${.CURDIR}/../libiberty/libiberty.a
97 .endif
98
99 .if exists(${.OBJDIR}/../libcpp)
100 LIBCPP=         ${.OBJDIR}/../libcpp/libcpp.a
101 .else
102 LIBCPP=         ${.CURDIR}/../libcpp/libcpp.a
103 .endif
104
105 .if exists(${.OBJDIR}/../libdecnumber)
106 LIBDECNUMBER=   ${.OBJDIR}/../libdecnumber/libdecnumber.a
107 .else
108 LIBDECNUMBER=   ${.CURDIR}/../libdecnumber/libdecnumber.a
109 .endif
110
111 .endif # !__CC_MAKEFILE_INC__