#!/bin/sh # if [ -z "$FLUPRO" ] ; then echo \$FLUPRO not defined exit 1 fi # echo \$FLUPRO = $FLUPRO FTOP=$FLUPRO export FTOP . ${FTOP}/flutil/ffluka.sh # Default: D_lines off DLINES="${DLINESOF}" # Default: bound checking on BOUNDS="${BOUNDSON}" EXTRAOP= set -- `getopt rhbnDNo: $*` while [ $# -gt 0 ] ; do case $1 in -h) cat < -r (set rQMD specific options) -h (print this help)] fff compiles fluka sources. -b switches on array bound checking (on by default) -n switches off array bound checking (on by default) -D switches on D line compilation (on by default) -N switches off D line compilation (on by default) -o extra compiler option to be added to the standard ones -r set rQMD specific options -h print this help file source file to be compiled ! exit ;; -b) BOUNDS="${BOUNDSON}" shift ;; -D) DLINES="${DLINESON}" shift ;; -n) BOUNDS= shift ;; -N) DLINES="${DLINESOF}" shift ;; -o) EXTRAOP="${EXTRAOP} -${2}" shift 2 ;; -r) DLINES= INCINC="${INCINC} -I${INC8}" shift ;; --) shift break ;; esac done # # echo $* FUCASE=`echo $* | grep "\.F"` FOCASE=`echo $* | grep "\.for"` FLCASE=`echo $* | grep "\.f"` if [ ! -z "$FUCASE" ] ; then FILE=`echo $* | sed -e 's/\.F//g' ` FSUF="F" elif [ ! -z "$FOCASE" ] ; then FILE=`echo $* | sed -e 's/\.for//g' ` FSUF="for" elif [ ! -z "$FLCASE" ] ; then FILE=`echo $* | sed -e 's/\.f//g' ` FSUF="f" else FILE="${*}" if [ -r ${FILE}.F ] ; then FSUF="F" elif [ -r ${FILE}.f ] ; then FSUF="f" elif [ -r ${FILE}.for ] ; then FSUF="for" else ${ECHOE} "\nTarget source file ${FILE} not found !" exit 2 fi fi #echo ${FILE}.${FSUF} if [[ "$TARGET_MACHINE" = "Linux" && "$FLUFOR" = "g77" ]] ; then if [ ! -z $DLINES ] ; then cp -f ${FILE}.${FSUF} hlphlp.f ${FTOP}/flutil/actdline rm -f hlphlp.f mv -f hlphlpd.f ${FILE}.FOR FSUF="FOR" DLINES= fi fi FFLAGS="${FOPTS} ${DLINES} ${BOUNDS}" # ${ECHOE} ${F77} -o ${FILE}.o -c $FFLAGS $EXTRAOP $INCINC ${FILE}.${FSUF} ${F77} -o ${FILE}.o -c $FFLAGS $EXTRAOP $INCINC ${FILE}.${FSUF} # exit 0