#!/bin/sh

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

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

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

# -x c:     Explicitly set compile language to C (no C++ nor object files
#           autodetected by extension)
# -Wall:    Report all warnings
# -O2:      Level 2 optimizations (default for speed)
# -static:  Static link with all libraries
# -pipe:    Use pipes for communication between stages of compilation
# -lm:      Link with math-library (has to be last argument!)
gcc -x c -Wall -O2 -static -pipe -o "$DEST" "$@" -lm
exit $?
