#!/bin/csh
#
# This has to be run in the netcdf source code directory.
# normally, the tarball untar's into something like
# <blah><blah>/netcdf-X.Y.Z 
# cd into netcdf-X.Y.Z and run this script.
#
# chmod 755 Build_netCDF_scott.csh
# ./Build_netCDF_scott.csh |& tee my.netcdf.log

setenv PREFIX /home/grad/sgoddard/netcdf

make clean
make distclean

if ( -d ${PREFIX} ) then
   echo "Installing into ${PREFIX}"
else   
   mkdir ${PREFIX}
   echo "Installing into ${PREFIX}"
endif

rm -fv macros.make config.status config.log config.cache

./configure CPPFLAGS="-fPIC" \
            LDFLAGS="-fPIC" \
            FFLAGS="-fPIC" \
            CFLAGS="-fPIC" \
            --prefix=${PREFIX} || exit 1

make         || exit 2
make test    || exit 3
make install || exit 4

