2010-06-27 18:54:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#Small wrapper to deal with compilation of the compiler and the stdlib.
|
|
|
|
|
2010-06-29 19:09:05 +02:00
|
|
|
SCRIPT_DIR=`dirname $0`
|
|
|
|
COMPILER_DIR=compiler #relative to the script_dir
|
2010-09-09 00:35:06 +02:00
|
|
|
COMPILER=heptc.d.byte
|
2010-06-27 18:54:05 +02:00
|
|
|
HEPTC=$COMPILER_DIR/$COMPILER
|
|
|
|
|
2010-08-29 23:50:50 +02:00
|
|
|
RUN_DIR=`pwd`
|
2010-06-29 19:09:05 +02:00
|
|
|
cd $SCRIPT_DIR
|
|
|
|
|
2010-06-27 18:54:05 +02:00
|
|
|
if [ ! -x $HEPTC ] #compile the compiler
|
|
|
|
then
|
2010-06-29 19:09:05 +02:00
|
|
|
cd $COMPILER_DIR
|
2010-08-03 22:39:01 +02:00
|
|
|
ocamlbuild -j 0 $COMPILER
|
2010-06-27 18:54:05 +02:00
|
|
|
cd -
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e lib/pervasives.epci ] #compile the stdlib
|
|
|
|
then
|
|
|
|
$HEPTC -nopervasives lib/pervasives.epi
|
|
|
|
fi
|
|
|
|
|
2010-08-29 23:50:50 +02:00
|
|
|
cd $RUN_DIR
|
2010-06-29 19:09:05 +02:00
|
|
|
|
|
|
|
$SCRIPT_DIR/$HEPTC -stdlib $SCRIPT_DIR/lib "$@" #call the compiler with the passed arguments.
|