#extcall batch file
#
# The various options used for the cc command are:
#
#    -n = allow for shared text segments.
#    -o = define output file name.
#    -s = strip out symbol table information.
#    -D = define a DEFINE on the command line.
#    -I = define an alternate include library.
#    -O = optimize the output.
#
# Modify the following variables for customer system usage.
#________________________________________________________________
CMPILR=cc
CLIB="-I /usr/include"
PLBINTLIB=../lib/plbsys.lib
LFLAGS=-n
PLBINT=../bin/plb.usr
#________________________________________________________________
#
date
echo compiling requested modules.
#
	echo $CMPILR -c $1 $CLIB extcall.o extcall.c
	if $CMPILR -c $1 $CLIB extcall.o extcall.c
	then
		OLIST="extcall.o "
	else
		ELIST="extcall.c "
	fi
#
# If the error list is not null, print a log of the modules in error.
# Otherwise link the new runtime.
#
if [ "$ELIST" != "" ]
then
	echo The following modules contained errors:
	echo $ELIST
else
	#link files
	#
	echo Linking new interpretor.
	echo $CMPILR $LFLAGS $CLIB -o $PLBINT $OLIST $PLBINTLIB
	$CMPILR $LFLAGS $CLIB -o $PLBINT $OLIST $PLBINTLIB
	super $PLBINT
fi
