xref: /openbsd/gnu/usr.bin/cc/Makefile.inc (revision 58ef3a88)
1# $FreeBSD: src/gnu/usr.bin/cc/Makefile.inc,v 1.66.8.1 2009/04/15 03:14:26 kensmith Exp $
2# $OpenBSD: Makefile.inc,v 1.3 2010/09/25 17:44:34 drahn Exp $
3
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.if defined(CROSSDIR)
11TOOLS_PREFIX=${CROSSDIR}
12.endif
13
14GCCLIB= ${.CURDIR}/../../../gcc
15GCCDIR=	${GCCLIB}/gcc
16
17.include "Makefile.tgt"
18
19# Machine description.
20MD_FILE=	${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
21GCC_TARGET=	${TARGET_ARCH}-unknown-openbsd${OSREV}
22
23CFLAGS+=	-DIN_GCC -DHAVE_CONFIG_H
24CFLAGS+=	-DPREFIX=\"${TOOLS_PREFIX}/usr/\"
25#CFLAGS+=	-DWANT_COMPILER_INVARIANTS
26
27# If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined
28# to get the proper sizes in limits.h
29.if defined(LONG_TYPE_SIZE)
30CFLAGS+=	-DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
31.endif
32
33.if ${TARGET_ARCH} != ${MACHINE_ARCH}
34CFLAGS+=	-DCROSS_COMPILE
35.endif
36
37.if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
38CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
39.endif
40
41.if exists(${.OBJDIR}/../cc_tools)
42CFLAGS+=	-I${.OBJDIR}/../cc_tools
43.endif
44CFLAGS+=	-I${.CURDIR}/../cc_tools
45# This must go after the -I for cc_tools to resolve ambiguities for hash.h
46# correctly.
47CFLAGS+=	-I${GCCDIR} -I${GCCDIR}/config
48
49CFLAGS+=	-I${GCCLIB}/include
50CFLAGS+=	-I${GCCLIB}/libcpp/include
51CFLAGS+=	-I${GCCLIB}/libdecnumber
52
53.if exists(${.OBJDIR}/../cc_int)
54LIBBACKEND=	${.OBJDIR}/../cc_int/libbackend.a
55.else
56LIBBACKEND=	${.CURDIR}/../cc_int/libbackend.a
57.endif
58
59LIBIBERTY=	/usr/lib/libiberty.a
60
61.if exists(${.OBJDIR}/../libcpp)
62LIBCPP=		${.OBJDIR}/../libcpp/libcpp.a
63.else
64LIBCPP=		${.CURDIR}/../libcpp/libcpp.a
65.endif
66
67.if exists(${.OBJDIR}/../libdecnumber)
68LIBDECNUMBER=	${.OBJDIR}/../libdecnumber/libdecnumber.a
69.else
70LIBDECNUMBER=	${.CURDIR}/../libdecnumber/libdecnumber.a
71.endif
72
73.endif # !__CC_MAKEFILE_INC__
74