#
#	script to build whole library under MSDOS.
#	this assumes MKS Toolkit 
#
E='clearing any previous library, map, or object files'
echo "$E"
rm -f *.obj *.map *.lib
E='making list of library files'
F=la$$.tmp
S=lb$$.tmp
L=lc$$.tmp
trap 'rm -f $F $S $L;exit' 0 1 2 3 4 14
echo "$E"
{
egrep -l COMLIB *.c
egrep -l DOSLIB *.c
}	|	sort -u > $F
E='making compilation script'
echo "$E"
sed -e 's/.*/tcc -c &/' $F > $S
E='making library script'
echo "$E"
#
#	shit-headed tlib requires space before &
#
sed -e 's/\(.*\)\(\.c\)/-+\1.obj \&/' $F > $L
E='compile the library'
echo "$E"
. $S
E='make the library'
echo "$E"
tlib mcomlib.lib /E /C @$L,mcomlib.map
E='checking for ramdisk'
echo "$E"
case $RAMDISK in
	?:)	cp -m mcomlib.lib mcomlib.map $RAMDISK;
		echo "copied lib and map to $RAMDISK";;
esac
E='removing object files'
rm -f *.obj
