--- /dev/null
+#!/bin/sh
+
+SMLBIN=/usr/local/sml/bin
+POSTGRES_INCLUDE=/usr/include/postgresql
+
+if [ -d .cm ] ; then
+ rm -rf .cm
+fi
+if [ -d libpq/.cm ] ; then
+ rm -rf libpq/.cm
+fi
+if [ -d libpq/FFI/.cm ] ; then
+ rm -rf libpq/FFI/.cm
+fi
+
+if ! cat build.sml | $SMLBIN/sml ; then
+ exit 1
+fi
+
+cd libpq
+
+$SMLBIN/ml-nlffigen -d FFI -lh LibpqH.libh -include ../libpq-h.sml -cm libpq.h.cm -D__builtin_va_list="void*" $POSTGRES_INCLUDE/libpq-fe.h
+
+if ! cat build.sml | $SMLBIN/sml ; then
+ exit 1
+fi
\ No newline at end of file
--- /dev/null
+(if CM.recomp "smlsql.cm" andalso CM.stabilize true "smlsql.cm" then
+ OS.Process.exit OS.Process.success
+ else
+ OS.Process.exit OS.Process.failure) : unit;
\ No newline at end of file
.cm
-CM
\ No newline at end of file
+CM
+*.sml
+*.cm
\ No newline at end of file
--- /dev/null
+(if CM.recomp "sources.cm" andalso CM.stabilize true "sources.cm" then
+ OS.Process.exit OS.Process.success
+ else
+ OS.Process.exit OS.Process.failure) : unit;
\ No newline at end of file