build script needs bash
[bpt/mlt.git] / build
diff --git a/build b/build
index 9d48509..db4d64f 100755 (executable)
--- a/build
+++ b/build
@@ -1,11 +1,25 @@
-#!/bin/sh
+#!/bin/bash
 
-SMLBIN=/usr/local/sml/bin
+source settings
+
+echo $SMLBIN/sml @SMLload=$BIN/mlt.$PLATFORM >src/mlt
+chmod +x src/mlt
+
+echo structure Settings = struct >settings.sml
+echo "    val arch = \"$PLATFORM\"" >>settings.sml
+echo "    val defaultFile = \"$DEFAULT\"" >>settings.sml
+echo "    val smlbin = \"$SMLBIN\"" >>settings.sml
+echo "    val mltdir = \"$MLTDIR\"" >>settings.sml
+echo end >>settings.sml
+
+echo "compiler $MLTDIR/src/sources.cm" >mlt.conf
+echo "lib $MLTDIR/src/lib/sources.cm" >>mlt.conf
+cat mlt.conf.base >>mlt.conf
 
 cd src
 
-if [ -f mlt.x86-linux ] ; then
-    rm mlt.x86-linux
+if [ -f mlt.$PLATFORM ] ; then
+    rm mlt.$PLATFORM
 fi
 if [ -d CM ] ; then
     rm -rf CM
@@ -13,6 +27,12 @@ fi
 if [ -d lib/CM ] ; then
     rm -rf lib/CM
 fi
+if [ -d .cm ] ; then
+    rm -rf .cm
+fi
+if [ -d lib/.cm ] ; then
+    rm -rf lib/.cm
+fi
 
 if ! cat build.sml | $SMLBIN/sml ; then
     exit 1
@@ -26,4 +46,5 @@ cd lib
 
 if ! cat build.sml | $SMLBIN/sml ; then
     exit 1
-fi
\ No newline at end of file
+fi
+