#!/bin/sh

# Fortran compile wrapper-script for 'compile.sh'.
# See that script for syntax and more info.

DEST="$1" ; shift
MEMLIMIT="$1" ; shift
MAINSOURCE="$1"

# Add -DONLINE_JUDGE or -DDOMJUDGE below if you want it make easier for teams
# to do local debugging.

# -x f95:       Explicitly set compile language to Fortran95 (no object
#               files or other languages autodetected by extension)
# -Wall:        Report all warnings
# -02:          Level 2 optimizations (default for speed)
# -static:      Static link with all libraries
# -cpp:         Run C preprocessor
gfortran -x f95 -static -Wall -O2 -cpp -o "$DEST" "$@"
exitcode=$?

# clean created files:
rm -f "$DEST.o"

exit $exitcode
