4 echo -check generate check code
5 echo -dmalloc link in dmalloc
6 echo -recover compile task code
7 echo -specdir directory
8 echo -debug generate debug symbols
9 echo -runtimedebug printout runtime debug messages
10 echo "-thread use support for multiple threads"
11 echo "-optimize call gcc with -O9 (optimize)"
12 echo "-nooptimize call gcc with -O0 (do not optimize)"
13 echo -curdir directory
14 echo -mainclass class with main method
16 echo -instructionfailures inject code for instructionfailures
20 ROBUSTROOT=~/research/Robust/src
21 REPAIRROOT=~/research/Repair/RepairCompiler/
48 elif [[ $1 = '-mainclass' ]]
50 JAVAOPTS="$JAVAOPTS -mainclass $2"
52 elif [[ $1 = '-dmalloc' ]]
55 elif [[ $1 = '-recover' ]]
58 JAVAOPTS="$JAVAOPTS -task"
59 elif [[ $1 = '-instructionfailures' ]]
61 JAVAOPTS="$JAVAOPTS -instructionfailures"
62 elif [[ $1 = '-check' ]]
65 JAVAOPTS="$JAVAOPTS -conscheck"
66 elif [[ $1 = '-specdir' ]]
72 elif [[ $1 = '-debug' ]]
74 EXTRAOPTIONS="$EXTRAOPTIONS -g"
75 elif [[ $1 = '-runtimedebug' ]]
77 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
78 elif [[ $1 = '-nooptimize' ]]
80 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
81 elif [[ $1 = '-optimize' ]]
83 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
84 elif [[ $1 = '-thread' ]]
86 JAVAOPTS="$JAVAOPTS -thread"
87 EXTRAOPTIONS="$EXTRAOPTIONS -DTHREADS"
88 elif [[ $1 = '-curdir' ]]
93 SRCFILES="$SRCFILES $1"
98 BUILDDIR="$CURDIR/tmpbuilddirectory"
106 if $CHECKFLAG #Generate structure files for repair tool
108 JAVAOPTS="$JAVAOPTS -struct structfile"
111 # Build bristlecone/java sources
113 java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
114 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
117 # Build all of the consistency specs
119 if $CHECKFLAG # CHECKFLAG
122 mkdir $BUILDDIR/specdir
123 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
125 echo > $BUILDDIR/specs
127 # compile specs into C code
128 for i in * # iterate over all directories
130 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
133 cat $BUILDDIR/structfile.struct $i.label > $i.struct
134 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
135 cp size.[c,h] $BUILDDIR/specdir
136 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
137 echo $i >> $BUILDDIR/specs
139 done # iterate over all directories
145 echo > $BUILDDIR/checkers.h
146 for i in `cat $BUILDDIR/specs`
148 gcc -O0 -g -c $i\_aux.c
149 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
153 #build and link everything
157 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
160 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/file.c \
161 $ROBUSTROOT/Runtime/Queue.c $ROBUSTROOT/Runtime/SimpleHash.c \
162 $ROBUSTROOT/Runtime/option.c $ROBUSTROOT/Runtime/garbage.c \
163 $ROBUSTROOT/Runtime/socket.c $ROBUSTROOT/Runtime/GenericHashtable.c \
164 $ROBUSTROOT/Runtime/object.c"
168 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
169 FILES="$FILES tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c"
171 FILES="$FILES $ROBUSTROOT/Runtime/thread.c"
176 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
177 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
182 EXTRAOPTIONS="$EXTRAOPTIONS -ldmalloc -DDMALLOC"
185 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
186 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin