heptagon/heptc

27 lines
527 B
Plaintext
Raw Normal View History

2010-06-27 18:54:05 +02:00
#!/bin/bash
#Small wrapper to deal with compilation of the compiler and the stdlib.
SCRIPT_DIR=`dirname $0`
COMPILER_DIR=compiler #relative to the script_dir
COMPILER=heptc.native
2010-06-27 18:54:05 +02:00
HEPTC=$COMPILER_DIR/$COMPILER
cd $SCRIPT_DIR
2010-06-27 18:54:05 +02:00
if [ ! -x $HEPTC ] #compile the compiler
then
cd $COMPILER_DIR
2010-06-27 18:54:05 +02:00
ocamlbuild $COMPILER
cd -
fi
if [ ! -e lib/pervasives.epci ] #compile the stdlib
then
$HEPTC -nopervasives lib/pervasives.epi
fi
cd -
$SCRIPT_DIR/$HEPTC -stdlib $SCRIPT_DIR/lib "$@" #call the compiler with the passed arguments.