2001-09-07 00:55:07 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
ARGS1=
|
|
|
|
FILE=
|
2003-07-10 05:28:35 -07:00
|
|
|
QUIET=no
|
2001-09-07 00:55:07 -07:00
|
|
|
while test "" != "$1"; do
|
2002-07-23 07:12:03 -07:00
|
|
|
case $1 in
|
2003-07-10 05:28:35 -07:00
|
|
|
-q) QUIET=yes;;
|
2002-07-23 07:12:03 -07:00
|
|
|
*.ml*) FILE=$1;;
|
|
|
|
*) ARGS1="$ARGS1 $1";;
|
|
|
|
esac
|
|
|
|
shift
|
2001-09-07 00:55:07 -07:00
|
|
|
done
|
|
|
|
|
2003-11-23 10:20:48 -08:00
|
|
|
# FILE must exist and be non empty (at least one line)
|
|
|
|
test -s "$FILE" || exit 1
|
2001-09-07 00:55:07 -07:00
|
|
|
|
2003-11-23 10:20:48 -08:00
|
|
|
set - `awk 'NR == 1' "$FILE"`
|
2001-09-07 00:55:07 -07:00
|
|
|
if test "$2" = "camlp4r" -o "$2" = "camlp4"; then
|
2002-07-23 07:12:03 -07:00
|
|
|
COMM="ocamlrun$EXE ../boot/$2$EXE -nolib -I ../boot"
|
2001-09-07 00:55:07 -07:00
|
|
|
if test "`basename $OTOP`" != "ocaml_stuff"; then
|
|
|
|
COMM="$OTOP/boot/$COMM"
|
|
|
|
fi
|
2002-07-23 07:12:03 -07:00
|
|
|
shift; shift
|
|
|
|
ARGS2=`echo $* | sed -e "s/[()*]//g"`
|
|
|
|
# ARGS1="$ARGS1 -verbose"
|
2003-07-10 05:28:35 -07:00
|
|
|
if test "$QUIET" = "no"; then echo $COMM $ARGS2 $ARGS1 $FILE; fi
|
2002-07-23 07:12:03 -07:00
|
|
|
$COMM $ARGS2 $ARGS1 $FILE
|
2001-09-07 00:55:07 -07:00
|
|
|
else
|
2002-07-23 07:12:03 -07:00
|
|
|
if test "`basename $FILE .mli`.mli" = "$FILE"; then
|
|
|
|
OFILE=`basename $FILE .mli`.ppi
|
|
|
|
else
|
|
|
|
OFILE=`basename $FILE .ml`.ppo
|
|
|
|
fi
|
2003-07-10 05:28:35 -07:00
|
|
|
if test "$QUIET" = "no"; then echo cp $FILE $OFILE; fi
|
2002-07-23 07:12:03 -07:00
|
|
|
cp $FILE $OFILE
|
2001-09-07 00:55:07 -07:00
|
|
|
fi
|