#! /bin/sh
S=${S-Splus}
rm -rf .Data makefile*
$S CHAPTER MASS.c
echo --reading in S files "(expect warnings)"
cat s6/*.q modified/deriv3.q | $S
rm -f .Data/.Audit .Data/.Last.value
$S make dump
rm -rf .Data makefile*
$S CHAPTER MASS.c optim.c lbfgsb.c arima.c ppr.f
$S make boot
rm all.S *.Sdata DUMP_FILES
rm -f .Data/.Audit .Data/.Last.value
echo --compiling
SHOME=`$S SHOME`; export SHOME
$S make S.so
rm *.o
echo --Installing help
ln -s modified/deriv3.sgml sgml/*.sgml .
ln -s Pima.tr.sgml Pima.te.sgml
ln -s Pima.tr.sgml Pima.tr2.sgml 
ln -s synth.tr.sgml synth.te.sgml
$S make HELPSGML=*.sgml install.help
rm *.sgml
