adding repair build script
authorbdemsky <bdemsky>
Wed, 6 Sep 2006 14:01:40 +0000 (14:01 +0000)
committerbdemsky <bdemsky>
Wed, 6 Sep 2006 14:01:40 +0000 (14:01 +0000)
Robust/src/buildscriptrepair [new file with mode: 0755]

diff --git a/Robust/src/buildscriptrepair b/Robust/src/buildscriptrepair
new file mode 100755 (executable)
index 0000000..2dd69e1
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+# arguments are:
+# 1 Name of executable
+# 2 Directory containing specs
+# 3-n List of class files to compile
+
+ROBUSTROOT=~/research/Robust/src
+REPAIRROOT=~/research/Repair/RepairCompiler/
+CURDIR=`pwd`
+BUILDDIR=$CURDIR/tmpbuilddirectory
+MAINFILE=$1
+shift
+
+cd $1
+SPECDIR=`pwd`
+cd $CURDIR
+shift
+
+mkdir $BUILDDIR
+java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
+$ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -struct $MAINFILE -struct \
+structfile.struct -task $@
+
+# Build all of the consistency specs
+
+cd $SPECDIR
+mkdir $BUILDDIR/specdir
+cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
+
+# compile specs into C code
+for i in *
+do
+cd $SPECDIR/$i
+cp $BUILDDIR/structfile.struct $i.struct
+java -cp $REPAIRROOT/:. MCC.Compiler -checkonly $i
+cp size.[c,h] $BUILDDIR/specdir
+cp $i.c $i_aux.[c,h] $BUILDDIR/specdir
+echo $i >> $BUILDDIR/specs
+done
+
+#compile C code
+
+cd $BUILDDIR/specdir
+./buildruntime
+for i in `cat $BUILDDIR/specs`
+do
+gcc -O0 -g -c $i.c
+done
+
+#build and link everything
+
+gcc -I$ROBUSTROOT/Runtime -I. -IRuntime/include -Itmpbuilddirectory \
+-O0 -DBOEHM_GC -LRuntime/lib/ -lgc -DTASK -g \
+tmpbuilddirectory/methods.c tmpbuilddirectory/taskdefs.c \
+$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/Queue.c \
+$ROBUSTROOT/Runtime/SimpleHash.c $ROBUSTROOT/Runtime/checkpoint.c \
+$ROBUSTROOT/Runtime/GenericHashtable.c $BUILDDIR/specdir/*.o \
+-o $MAINFILE.bin