4 echo -check generate check code
5 echo -dmalloc link in dmalloc
6 echo -recover compile task code
7 echo -specdir directory
8 echo -taskstate do task state analysis
9 echo -debug generate debug symbols
10 echo -webinterface enable web interface
11 echo -runtimedebug printout runtime debug messages
12 echo "-thread use support for multiple threads"
13 echo "-optimize call gcc with -O9 (optimize)"
14 echo "-nooptimize call gcc with -O0 (do not optimize)"
15 echo -curdir directory
16 echo -mainclass class with main method
18 echo -instructionfailures inject code for instructionfailures
22 ROBUSTROOT=~/research/Robust/src
23 REPAIRROOT=~/research/Repair/RepairCompiler/
51 elif [[ $1 = '-mainclass' ]]
53 JAVAOPTS="$JAVAOPTS -mainclass $2"
55 elif [[ $1 = '-taskstate' ]]
57 JAVAOPTS="$JAVAOPTS -taskstate"
58 elif [[ $1 = '-dmalloc' ]]
61 elif [[ $1 = '-recover' ]]
64 JAVAOPTS="$JAVAOPTS -task"
65 elif [[ $1 = '-webinterface' ]]
67 JAVAOPTS="$JAVAOPTS -webinterface"
68 elif [[ $1 = '-instructionfailures' ]]
70 JAVAOPTS="$JAVAOPTS -instructionfailures"
71 elif [[ $1 = '-check' ]]
74 JAVAOPTS="$JAVAOPTS -conscheck"
75 elif [[ $1 = '-specdir' ]]
81 elif [[ $1 = '-debug' ]]
83 EXTRAOPTIONS="$EXTRAOPTIONS -g"
84 elif [[ $1 = '-runtimedebug' ]]
86 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
87 elif [[ $1 = '-nooptimize' ]]
89 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
90 elif [[ $1 = '-optimize' ]]
92 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
93 elif [[ $1 = '-thread' ]]
95 JAVAOPTS="$JAVAOPTS -thread"
96 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
98 elif [[ $1 = '-curdir' ]]
103 SRCFILES="$SRCFILES $1"
108 BUILDDIR="$CURDIR/tmpbuilddirectory"
116 if $CHECKFLAG #Generate structure files for repair tool
118 JAVAOPTS="$JAVAOPTS -struct structfile"
121 # Build bristlecone/java sources
123 java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
124 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
127 # Build all of the consistency specs
129 if $CHECKFLAG # CHECKFLAG
132 mkdir $BUILDDIR/specdir
133 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
135 echo > $BUILDDIR/specs
137 # compile specs into C code
138 for i in * # iterate over all directories
140 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
143 cat $BUILDDIR/structfile.struct $i.label > $i.struct
144 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
145 cp size.[c,h] $BUILDDIR/specdir
146 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
147 echo $i >> $BUILDDIR/specs
149 done # iterate over all directories
155 echo > $BUILDDIR/checkers.h
156 for i in `cat $BUILDDIR/specs`
158 gcc -O0 -g -c $i\_aux.c
159 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
163 #build and link everything
167 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
170 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/file.c \
171 $ROBUSTROOT/Runtime/Queue.c $ROBUSTROOT/Runtime/SimpleHash.c \
172 $ROBUSTROOT/Runtime/option.c $ROBUSTROOT/Runtime/garbage.c \
173 $ROBUSTROOT/Runtime/socket.c $ROBUSTROOT/Runtime/GenericHashtable.c \
174 $ROBUSTROOT/Runtime/object.c"
178 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
179 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
184 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
189 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
190 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
195 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
198 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
199 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin