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