#!/bin/sh

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

DEST="$1" ; shift
MEMLIMIT="$1" ; shift
MAINSOURCE="${ENTRY_POINT:-$1}"
COMPILESCRIPTDIR="$(dirname "$0")"

# Report the entry point, so it can be saved, e.g. for later replay:
if [ -z "$ENTRY_POINT" ]; then
	echo "Info: detected entry_point: $MAINSOURCE"
fi

exec swipl "$COMPILESCRIPTDIR/compile.plg" "$MAINSOURCE" "$DEST"

exit 0
