#!/bin/sh
# Install Njoy 2012 with dragr module
#
System=`uname`
echo "System   :" $System
mkdir $System
cd $System
if [ $System = 'Linux' ]; then
  ln -s ../Makefile_linux Makefile
elif [ $System = 'Darwin' ]; then
  ln -s ../Makefile_linux Makefile
elif [ $System = 'AIX' ]; then
  ln -s ../Makefile_aix Makefile
elif [ $System = 'SunOS' ]; then
  ln -s ../Makefile_sun Makefile
else
  echo "Only Linux, Darwin, AIX and SunOS are supported."
  exit 1
fi
ln -s ../up137_EPM upn
ln -s ../upd.f90 .
ln -s ../figs .
ln -s ../NJOYMan.cls .
make upd
cat ../src_2012p0 ../src_xsm ../src_dragr_cat ../dragx.tex > src
./upd x
./upd l
if [ $System = 'SunOS' ]; then
  /usr/ccs/bin/make njoy
elif [ $System = 'Darwin' ]; then
  make all
else
  make njoy
fi
rm src upn
