Makefile.inc revision 1.12
1#	$NetBSD: Makefile.inc,v 1.12 2011/06/03 13:31:25 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
21VERSSTR = PACKAGE_STRING " for ${TARGOS}-${TARGMACH}"
22
23CPPFLAGS+=	-DGCC_COMPAT
24CPPFLAGS+=	-DVERSSTR=${VERSSTR:Q}
25CPPFLAGS+=	-Dos_${TARGOS}
26CPPFLAGS+=	-Dmach_${TARGMACH}
27CPPFLAGS+=	-I${PCC_DIR}/include
28
29.include <bsd.endian.mk>
30
31# We only build binaries from here where the pcc host and target architectures
32# will be the same. For a cross-compiler, use the tools/pcc build.
33#
34.if ${TARGET_ENDIANNESS} == "1234"
35CPPFLAGS+=	-DHOST_LITTLE_ENDIAN
36CPPFLAGS+=	-DTARGET_LITTLE_ENDIAN
37.elif ${TARGET_ENDIANNESS} == "4321"
38CPPFLAGS+=	-DHOST_BIG_ENDIAN
39CPPFLAGS+=	-DTARGET_BIG_ENDIAN
40.else
41ERROR!= echo "ERROR: Unknown TARGET_ENDIANNESS" >&2;echo
42.endif
43
44# top-level Makefile.inc
45.include "../../../Makefile.inc"
46