2012-03-26 18:31:12 +04:00
|
|
|
# $NetBSD: Makefile.inc,v 1.17 2012/03/26 14:31:12 plunky Exp $
|
2008-08-24 09:47:05 +04:00
|
|
|
|
2010-01-20 14:45:54 +03:00
|
|
|
PCC_DIR:=${.PARSEDIR}
|
|
|
|
PCC_DIST=${PCC_DIR}/dist/pcc
|
|
|
|
PCC_LIBS=${PCC_DIR}/dist/pcc-libs
|
2008-08-24 09:47:05 +04:00
|
|
|
|
2011-09-01 17:00:14 +04:00
|
|
|
# (these strings will be updated by the prepare-import.sh script)
|
|
|
|
PCC_VERSION=1.1.0.DEVEL
|
2012-03-26 18:31:12 +04:00
|
|
|
PCC_DATESTAMP=20120325
|
2011-09-01 17:00:14 +04:00
|
|
|
|
2008-08-24 09:47:05 +04:00
|
|
|
TARGOS = netbsd
|
2010-01-20 14:45:54 +03:00
|
|
|
|
2010-02-05 11:58:47 +03:00
|
|
|
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
|
2008-08-24 09:47:05 +04:00
|
|
|
TARGMACH = mips
|
2010-02-05 21:41:25 +03:00
|
|
|
.elif ${MACHINE_ARCH} == "x86_64"
|
|
|
|
TARGMACH = amd64
|
2008-08-24 09:47:05 +04:00
|
|
|
.else
|
2010-02-05 11:58:47 +03:00
|
|
|
TARGMACH = ${MACHINE_ARCH}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !exists(${PCC_DIST}/arch/${TARGMACH})
|
|
|
|
ERROR!= echo "ERROR: ${TARGMACH} not yet supported - write code!" >&2;echo
|
2008-08-24 09:47:05 +04:00
|
|
|
.endif
|
|
|
|
|
2011-09-01 17:00:14 +04:00
|
|
|
VERSSTR="pcc ${PCC_VERSION} ${PCC_DATESTAMP} for ${TARGOS}-${TARGMACH}"
|
2010-02-04 01:13:13 +03:00
|
|
|
|
2010-06-03 23:17:22 +04:00
|
|
|
CPPFLAGS+= -DGCC_COMPAT
|
2011-06-07 17:30:35 +04:00
|
|
|
CPPFLAGS+= -DPCC_DEBUG
|
2010-02-04 01:13:13 +03:00
|
|
|
CPPFLAGS+= -DVERSSTR=${VERSSTR:Q}
|
2010-01-20 14:45:54 +03:00
|
|
|
CPPFLAGS+= -Dos_${TARGOS}
|
|
|
|
CPPFLAGS+= -Dmach_${TARGMACH}
|
2010-02-11 17:22:30 +03:00
|
|
|
CPPFLAGS+= -I${PCC_DIR}/include
|
2008-08-24 09:47:05 +04:00
|
|
|
|
2010-02-11 17:18:45 +03:00
|
|
|
.include <bsd.endian.mk>
|
|
|
|
|
|
|
|
# We only build binaries from here where the pcc host and target architectures
|
|
|
|
# will be the same. For a cross-compiler, use the tools/pcc build.
|
|
|
|
#
|
|
|
|
.if ${TARGET_ENDIANNESS} == "1234"
|
|
|
|
CPPFLAGS+= -DHOST_LITTLE_ENDIAN
|
|
|
|
CPPFLAGS+= -DTARGET_LITTLE_ENDIAN
|
|
|
|
.elif ${TARGET_ENDIANNESS} == "4321"
|
|
|
|
CPPFLAGS+= -DHOST_BIG_ENDIAN
|
|
|
|
CPPFLAGS+= -DTARGET_BIG_ENDIAN
|
|
|
|
.else
|
|
|
|
ERROR!= echo "ERROR: Unknown TARGET_ENDIANNESS" >&2;echo
|
|
|
|
.endif
|
|
|
|
|
2010-02-11 17:36:32 +03:00
|
|
|
# top-level Makefile.inc
|
|
|
|
.include "../../../Makefile.inc"
|