#!/bin/sh
# build the model from its makefile

if test $# = 0
  then
	echo "Available ProjNames:"
	ls $SMD_HOME/Projects
    exit
fi


ProjName=$1
export ProjName

Tool=Serial
export Tool

ModelPath=$SMD_HOME/Projects/
export ModelPath

DriverPath=$SMD_HOME/SMDriver/
export DriverPath

cd $DriverPath/Sources/Driver_Sources/

if dmake -f Driver.make.$Tool.Sun   2> comp_msg
	then
		echo Compilation completed successfully
	else
		echo Compilation failed
		echo Error file: $DriverPath/Sources/Driver_Sources/comp_msg
		more $DriverPath/Sources/Driver_Sources/comp_msg
fi


cd $DriverPath
echo Done
