unset CDPATH
-TEMP=`getopt -o 'gI:o:' --long 'help,pkgdir:' -n goaljobs -- "$@"`
+TEMP=`getopt -o 'gI:o:' --long 'help,package:,pkgdir:' -n goaljobs -- "$@"`
if [ $? -ne 0 ]; then
echo "goaljobs: could not parse command line arguments"
exit 1
-o)
output="$2"
shift 2;;
+ --package)
+ passthru[i++]="-package"
+ passthru[i++]="$2"
+ shift 2;;
--pkgdir)
pkgdir="$2"
shift 2;;
pkg[0]="-package"
pkg[1]="goaljobs,goaljobs.syntax"
else
+ # Get the dependencies manually. Note that calendar requires
+ # unix & str.
pkgdir="$(cd $pkgdir; pwd)"
pkg[0]="-I"
pkg[1]="$pkgdir"
pkg[2]="unix.$libext"
- pkg[3]="goaljobs.$libext"
- pkg[4]="-pp"
- pkg[5]="camlp4o $pkgdir/pa_goal.cmo"
+ pkg[3]="str.$libext"
+ pkg[4]="-I"
+ pkg[5]="+calendar"
+ pkg[6]="calendarLib.$libext"
+ pkg[7]="goaljobs.$libext"
+ pkg[8]="-pp"
+ pkg[9]="camlp4o $pkgdir/pa_goal.cmo"
fi
# Compile the input file(s).
echo \
-ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -o "$output"
-ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -o "$output"
+ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -linkpkg -o "$output"
+ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -linkpkg -o "$output"
-rm -f $main
+mainbase="$(echo $main | sed s,\.ml$,,)"
+rm -f "$mainbase"*