Makefile.inc revision 1.8
1# $NetBSD: Makefile.inc,v 1.8 2010/02/11 14:18:45 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 23libexecdir = /usr/libexec 24includedir = /usr/include 25 26CPPFLAGS+= -DVERSSTR=${VERSSTR:Q} 27CPPFLAGS+= -DLIBEXECDIR=\"${libexecdir}/\" 28CPPFLAGS+= -DINCLUDEDIR=\"${includedir}/\" 29CPPFLAGS+= -Dos_${TARGOS} 30CPPFLAGS+= -Dmach_${TARGMACH} 31CPPFLAGS+= -I${PCC_DIR} 32 33.include <bsd.endian.mk> 34 35# We only build binaries from here where the pcc host and target architectures 36# will be the same. For a cross-compiler, use the tools/pcc build. 37# 38.if ${TARGET_ENDIANNESS} == "1234" 39CPPFLAGS+= -DHOST_LITTLE_ENDIAN 40CPPFLAGS+= -DTARGET_LITTLE_ENDIAN 41.elif ${TARGET_ENDIANNESS} == "4321" 42CPPFLAGS+= -DHOST_BIG_ENDIAN 43CPPFLAGS+= -DTARGET_BIG_ENDIAN 44.else 45ERROR!= echo "ERROR: Unknown TARGET_ENDIANNESS" >&2;echo 46.endif 47 48.if exists(${.CURDIR}/../../../Makefile.inc) 49.include "${.CURDIR}/../../../Makefile.inc" 50.endif 51