#!/bin/sh

DIR=${HOME}/out

if [ $# -lt 1 ] ; then
  echo "usage: $0 <optimized | all> [install_dir]"
  echo "       Installs SNOPT libraries in directories with root \"${HOME}/out\""
  echo "       (or  root \"install_dir\" if the last argument is present)       " 
  echo "       \"$0 all\" installs both optimized and debugged libraries        "
  exit 1 
fi

OPT=$1
INSTALL_DIR=$2

if [ "$INSTALL_DIR" = "" ]; then
   INSTALL_DIR=$DIR
fi

echo "                                                             "
echo "SNOPT libraries to be installed in directory \"$INSTALL_DIR\""
echo "                                                             "

if [ "$OPT" = "all" ]; then
   gmake all OUT=${INSTALL_DIR}
else
   gmake     OUT=${INSTALL_DIR} 
fi

echo "                             "
echo "SNOPT installation complete:."
