# (Magic first line)

# $1 = architecture (e.g. DS)
# $2 = bin directory (absolute path)
# $3 = lib directory (absolute path)
# $4 = "makelib" or ""

if ( "$1" == "" || "$2" == "" || "$3" == "" ) then
  echo \ \ Read \"doc/notes/Installation.txt\" FIRST!
  exit
endif

cat COPYRIGHT

set verbose

if ( "$4" == "makelib" ) then
  pushd qm/lib
  ../$1/QM .. Quest.qm < ../../sys/CompLibrary.qst
  popd
endif

cp -i qm/$1/QM $2/QM

echo $2/QM $3/quest Quest.qm > $2/Quest
chmod +x $2/Quest

mkdir $3/quest

cp -i qm/Quest.qm $3/quest/Quest.qm

cp -i sys/PublicLibrary.qst $3/quest/Library.qst
echo command\"SetPath $3/quest:.\"\; >> $3/quest/Library.qst

cp -i sys/lib/*.spec $3/quest
cp -i qm/lib/*.x $3/quest
