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