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