## Define some of the tools that are used by the make process.

# The u++ translator is used to build the kernel, and library support code.

CC = ${PACKAGE}/src/translator/bin-${VENDOR}-${CPU}/u++

CCFLAGS = -quiet -B${PACKAGE}/src/translator/lib-${VENDOR}-${CPU} -I. -I${PACKAGE}/src/kernel -I${PACKAGE}/src/collection -I${PACKAGE}/src/library -I${PACKAGE}/src/trace -I${PACKAGE}/src/debugger -I${PACKAGE}/src/profiler -DPACKAGE=\"${PACKAGE}\" -DVERSION=\"${VERSION}\" -DTMPDIR=\"${TMPDIR}\"
#CCFLAGS += -profile -D__U_PROFILEABLE_ONLY__

.IF ${TOS} == linux	# TEMPORARY, linux problems
	# check for name change of sigcontext
	CCFLAGS += ${shell if grep "sigcontext_struct" /usr/include/asm/sigcontext.h > /dev/null ; then echo "-D__U_SIGCONTEXT_STRUCT_H__" ; else echo ""; fi}
.END

.IF ${TCPU} == mips
	CCFLAGS += # -O2 -DNDEBUG
.ELSE
	HOSTNAME = $(shell hostname)
	.IF ${HOSTNAME} == plg2.math
		CCFLAGS += -g -msupersparc -Wall # -O3
	.ELSE
		# bug in gcc 2.6.3 with anything greater than -O1 for alpha
		# bug in gcc 2.7.0 with any -O for inline expansion
		CCFLAGS += # -O3 -DNDEBUG
	.END
.END

AS = as

.IF ${TVENDOR} == sun
    .IF ${TCPU} == sparc
	ASFLAGS += -P -I/usr/include -D_ASM -D__${TVENDOR}__ -D__${TOS}__ -D__${TCPU}__
    .END
.ELIF ${TVENDOR} == sgi
    .IF ${MULTI} == TRUE
	ASFLAGS += -mips3
    .END
    ASFLAGS += -D__${TVENDOR}__ -D__${TOS}__ -D__${TCPU}__
.ELIF ${TVENDOR} == gizmo
    AS = gcc
    ASFLAGS += -b gizmo -V 2.6.2 -c
.END

AR = ar cr

RL = ${shell if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; then echo "ranlib"; else echo "echo"; fi}

RM = rm -rf

INSTALL = cp
