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 -runtimedebug printout runtime debug messages
11 echo "-thread use support for multiple threads"
12 echo "-optimize call gcc with -O9 (optimize)"
13 echo "-nooptimize call gcc with -O0 (do not optimize)"
14 echo -curdir directory
15 echo -mainclass class with main method
17 echo -instructionfailures inject code for instructionfailures
21 ROBUSTROOT=~/research/Robust/src
22 REPAIRROOT=~/research/Repair/RepairCompiler/
50 elif [[ $1 = '-mainclass' ]]
52 JAVAOPTS="$JAVAOPTS -mainclass $2"
54 elif [[ $1 = '-taskstate' ]]
56 JAVAOPTS="$JAVAOPTS -taskstate"
57 elif [[ $1 = '-dmalloc' ]]
60 elif [[ $1 = '-recover' ]]
63 JAVAOPTS="$JAVAOPTS -task"
64 elif [[ $1 = '-instructionfailures' ]]
66 JAVAOPTS="$JAVAOPTS -instructionfailures"
67 elif [[ $1 = '-check' ]]
70 JAVAOPTS="$JAVAOPTS -conscheck"
71 elif [[ $1 = '-specdir' ]]
77 elif [[ $1 = '-debug' ]]
79 EXTRAOPTIONS="$EXTRAOPTIONS -g"
80 elif [[ $1 = '-runtimedebug' ]]
82 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
83 elif [[ $1 = '-nooptimize' ]]
85 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
86 elif [[ $1 = '-optimize' ]]
88 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
89 elif [[ $1 = '-thread' ]]
91 JAVAOPTS="$JAVAOPTS -thread"
92 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS -lpthread"
94 elif [[ $1 = '-curdir' ]]
99 SRCFILES="$SRCFILES $1"
104 BUILDDIR="$CURDIR/tmpbuilddirectory"
112 if $CHECKFLAG #Generate structure files for repair tool
114 JAVAOPTS="$JAVAOPTS -struct structfile"
117 # Build bristlecone/java sources
119 java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
120 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
123 # Build all of the consistency specs
125 if $CHECKFLAG # CHECKFLAG
128 mkdir $BUILDDIR/specdir
129 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
131 echo > $BUILDDIR/specs
133 # compile specs into C code
134 for i in * # iterate over all directories
136 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
139 cat $BUILDDIR/structfile.struct $i.label > $i.struct
140 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
141 cp size.[c,h] $BUILDDIR/specdir
142 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
143 echo $i >> $BUILDDIR/specs
145 done # iterate over all directories
151 echo > $BUILDDIR/checkers.h
152 for i in `cat $BUILDDIR/specs`
154 gcc -O0 -g -c $i\_aux.c
155 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
159 #build and link everything
163 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
166 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/file.c \
167 $ROBUSTROOT/Runtime/Queue.c $ROBUSTROOT/Runtime/SimpleHash.c \
168 $ROBUSTROOT/Runtime/option.c $ROBUSTROOT/Runtime/garbage.c \
169 $ROBUSTROOT/Runtime/socket.c $ROBUSTROOT/Runtime/GenericHashtable.c \
170 $ROBUSTROOT/Runtime/object.c"
174 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
175 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
180 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
185 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
186 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
191 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
194 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
195 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin