# -*- mode: mak -*-
###############################################################################
# File:         TOOLSET/mri68k.def
# Contents:     microtec (4.3/4.4)
#
# Revision History:
#       06/04/00 APY    4.4
#       22/04/02 APY    rpccpp option
###############################################################################

toolset		= mri68k

o		= obj
s		= asm
a		= lib
exe		=

.SUFFIXES:	.asm
.PHONY:		mri mri2


ifeq	"$(mri_ver)" "44"
mri:
	@if [ -z "$$MRI44" ]; then echo MRI44 env var not set; exit 2; fi; \
	echo -n "[Toolset mri68k - Microtec Research C 4.4 "; \
	if [ -z "`$(grep) 4.4 $$MRI44/version`" ]; then echo not MRI 4.4; exit 2; fi;

mri		= $(subst \,/,$(strip $(MRI44)))
ifeq	"$(findstring $(PATH),$(MRI44))" ""
PATH		:= $(PATH);$(mri)
endif

else
ifeq	"$(mri_ver)" "43"
mri:
	@if [ -z "$$MRI43" ]; then echo MRI43 env var not set; exit 2; fi; \
	echo -n "[Toolset mri68k - Microtec Research C 4.3 "; \
	if [ -z "`$(grep) 4.3 $$MRI43/version`" ]; then echo not MRI 4.3; exit 2; fi;

mri		= $(subst \,/,$(strip $(MRI43)))
ifeq	"$(findstring $(PATH),$(MRI43))" ""
PATH		:= $(PATH);$(mri)
endif

else
ifeq	"$(mri_ver)" "51"
mri:
	@if [ -z "$$MRI51" ]; then echo MRI51 env var not set; exit 2; fi; \
	echo -n "[Toolset mri68k - Microtec Research C 5.1 "; \
	if [ -z "`$(grep) 5.1 $$MRI51/version`" ]; then echo not MRI 5.1; exit 2; fi;

mri		= $(subst \,/,$(strip $(MRI51)))
ifeq	"$(findstring $(PATH),$(MRI51))" ""
PATH		:= $(PATH);$(mri)
endif

else
ifdef mri_ver
mri:
	@echo "ERROR: Specified MRI version $(mri_ver) not supported by this toolset"; exit 2

else    #. Unspecific
mri:
	@if [ -z "$$MRI" ]; then echo MRI env var not set; exit 2; fi; \
	echo -n "[Toolset mri68k - Microtec Research C X.X ";

mri		= $(subst \,/,$(strip $(MRI)))
ifeq	"$(findstring $(PATH),$(MRI))" ""
PATH		:= $(PATH);$(mri)
endif   #. n/a
endif   #. x.x
endif   #. 5.1
endif   #. 4.3
endif	#. 4.4

mri2:
	@if [ -n "$$VISIONCLICK" ]; then \
		echo "and VisionCLICK]"; \
	else echo "and PowerSCOPE]"; fi

ifdef VISIONCLICK
est32		= $(subst \,/,$(strip $(VISIONCLICK)))
else
est32		= --dummy--
endif

RPCGEN_CPP	:= mcc68kcp
RPCGEN_CFLAGS	:= -Ex
ifdef OPTIONS
ifneq "$(findstring purify,$(OPTIONS))" ""	# use rpccpp, not mcc68kcp
RPCGEN_CPP	:= rpccpp
RPCGEN_CFLAGS	:= -E
endif
endif
export RPCGEN_CPP RPCGEN_CFLAGS

#
