heptagon/heptc
Adrien Guatto 4794045208 Reworked Obc AST: from right patterns to extvalues.
I introduced a notion of extended values in Obc expressions,
replacing the Epattern constructor. Patterns may now only
occur at their rightful place, on the left of an assignment.

This change allows to index global constant arrays.
2011-05-30 16:25:00 +02:00

43 lines
832 B
Bash
Executable file

#!/bin/bash
#Small wrapper to deal with compilation of the compiler and the stdlib.
RUN_DIR="`pwd`"
SCRIPT_DIR="$RUN_DIR/`dirname $0`"
COMPILER_DIR="$SCRIPT_DIR/compiler"
COMPILER=heptc.byte
COMPILER_DEBUG=heptc.d.byte
LIB_DIR="$SCRIPT_DIR/lib"
#the symlink
HEPTC="$COMPILER_DIR/$COMPILER"
HEPTC_DEBUG="$COMPILER_DIR/$COMPILER_DEBUG"
#compile the compiler
if [ ! -x "$HEPTC" ]
then
if [ -x "$HEPTC_DEBUG" ]
then
#use the debug
HEPTC=$HEPTC_DEBUG
else
cd "$COMPILER_DIR"
ocamlbuild -j 0 "$COMPILER"
cd -
fi
fi
#compile the stdlib
if [ ! -e "$LIB_DIR/pervasives.epci" ] || [ "$HEPTC" -nt "$LIB_DIR/pervasives.epci" ]
then
cd "$LIB_DIR"
echo "Recompile pervasives.epci"
"$HEPTC" -nopervasives pervasives.epi
cd -
fi
#call the compiler with the passed arguments.
cd "$RUN_DIR"
"$HEPTC" -stdlib "$LIB_DIR" "$@"