heptagon/heptc

37 lines
646 B
Text
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.
2010-08-29 23:50:50 +02:00
RUN_DIR=`pwd`
2011-01-12 15:39:47 +01:00
SCRIPT_DIR=$RUN_DIR/`dirname $0`
COMPILER_DIR=$SCRIPT_DIR/compiler
COMPILER=heptc.byte
LIB_DIR=$SCRIPT_DIR/lib
#the symlink
HEPTC=$COMPILER_DIR/$COMPILER
#compile the compiler
if [ ! -x $HEPTC ]
2010-06-27 18:54:05 +02:00
then
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
2011-01-12 15:39:47 +01:00
#compile the stdlib
if [ ! -e $LIB_DIR/pervasives.epci ] || [ $HEPTC -nt $LIB_DIR/pervasives.epci ]
2010-06-27 18:54:05 +02:00
then
2011-01-12 15:39:47 +01:00
cd $LIB_DIR
echo "Recompile pervasives.epci"
$HEPTC -nopervasives pervasives.epi
cd -
2010-06-27 18:54:05 +02:00
fi
2011-01-12 15:39:47 +01:00
#call the compiler with the passed arguments.
2010-08-29 23:50:50 +02:00
cd $RUN_DIR
2011-01-12 15:39:47 +01:00
$HEPTC -stdlib $LIB_DIR "$@"