Makefile.inc revision 1.14
1#	$NetBSD: Makefile.inc,v 1.14 2011/06/07 13:30:35 plunky Exp $
2
3PCC_DIR:=${.PARSEDIR}
4PCC_DIST=${PCC_DIR}/dist/pcc
5PCC_LIBS=${PCC_DIR}/dist/pcc-libs
6
7TARGOS = netbsd
8
9.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
10TARGMACH = mips
11.elif ${MACHINE_ARCH} == "x86_64"
12TARGMACH = amd64
13.else
14TARGMACH = ${MACHINE_ARCH}
15.endif
16
17.if !exists(${PCC_DIST}/arch/${TARGMACH})
18ERROR!= echo "ERROR: ${TARGMACH} not yet supported - write code!" >&2;echo
19.endif
20
21# this string will be updated by the prepare-import.sh script
22VERSSTR = PACKAGE_STRING " for ${TARGOS}-${TARGMACH}"
23
24CPPFLAGS+=	-DGCC_COMPAT
25CPPFLAGS+=	-DPCC_DEBUG
26CPPFLAGS+=	-DVERSSTR=${VERSSTR:Q}
27CPPFLAGS+=	-Dos_${TARGOS}
28CPPFLAGS+=	-Dmach_${TARGMACH}
29CPPFLAGS+=	-I${PCC_DIR}/include
30
31.include <bsd.endian.mk>
32
33# We only build binaries from here where the pcc host and target architectures
34# will be the same. For a cross-compiler, use the tools/pcc build.
35#
36.if ${TARGET_ENDIANNESS} == "1234"
37CPPFLAGS+=	-DHOST_LITTLE_ENDIAN
38CPPFLAGS+=	-DTARGET_LITTLE_ENDIAN
39.elif ${TARGET_ENDIANNESS} == "4321"
40CPPFLAGS+=	-DHOST_BIG_ENDIAN
41CPPFLAGS+=	-DTARGET_BIG_ENDIAN
42.else
43ERROR!= echo "ERROR: Unknown TARGET_ENDIANNESS" >&2;echo
44.endif
45
46# top-level Makefile.inc
47.include "../../../Makefile.inc"
48