#!/bin/sh
set -xv
LIMDIR="/Users/ioulianikolskaia/Boulot/CODES/LIM1D_SVN/dev_v3.20_2016_gravity_drainage/SOURCES/source_3.20/"
archfile=./gfortran_mac.inc
KEY_LIM=""
cppdefs="${KEY_LIM}"

#---------------------------------------------------------------------
# other flags
#---------------------------------------------------------------------
oflags=""
exe=lim1d.x

#---------------------------------------------------------------------
#create source file lists and exit
#---------------------------------------------------------------------
if [ $1 == "SRC" ]; then
   find ${LIMDIR} -name "*.[fF]" -print > LIM_SRC.lst
   find ${LIMDIR} -name "*.com" -print >> LIM_SRC.lst
exit 0
fi

#---------------------------------------------------------------------
# get common blocks
#---------------------------------------------------------------------
cp ${LIMDIR}/*.com .

#---------------------------------------------------------------------
# make makefile                                                                                                    
#---------------------------------------------------------------------
./mkmf -c "${cppdefs}" -o "${oflags}" -t ${archfile} -p ${exe} LIM_SRC.lst
