4 echo -check generate check code
5 echo -recover compile task code
6 echo -specdir directory
7 echo -debug generate debug symbols
8 echo -runtimedebug printout runtime debug messages
9 echo "-optimize call gcc with -O9 (optimize)"
10 echo "-nooptimize call gcc with -O0 (do not optimize)"
11 echo -curdir directory
12 echo -mainclass class with main method
14 echo -instructionfailures inject code for instructionfailures
18 ROBUSTROOT=~/research/Robust/src
19 REPAIRROOT=~/research/Repair/RepairCompiler/
45 elif [[ $1 = '-mainclass' ]]
47 JAVAOPTS="$JAVAOPTS -mainclass $2"
49 elif [[ $1 = '-recover' ]]
52 JAVAOPTS="$JAVAOPTS -task"
53 elif [[ $1 = '-instructionfailures' ]]
55 JAVAOPTS="$JAVAOPTS -instructionfailures"
56 elif [[ $1 = '-check' ]]
59 JAVAOPTS="$JAVAOPTS -conscheck"
60 elif [[ $1 = '-specdir' ]]
66 elif [[ $1 = '-debug' ]]
68 EXTRAOPTIONS="$EXTRAOPTIONS -g"
69 elif [[ $1 = '-runtimedebug' ]]
71 EXTRAOPTIONS="$EXTRAOPTIONS -DDEBUG"
72 elif [[ $1 = '-nooptimize' ]]
74 EXTRAOPTIONS="$EXTRAOPTIONS -O0"
75 elif [[ $1 = '-optimize' ]]
77 EXTRAOPTIONS="$EXTRAOPTIONS -O9"
78 elif [[ $1 = '-curdir' ]]
83 SRCFILES="$SRCFILES $1"
88 BUILDDIR="$CURDIR/tmpbuilddirectory"
96 if $CHECKFLAG #Generate structure files for repair tool
98 JAVAOPTS="$JAVAOPTS -struct structfile"
101 # Build bristlecone/java sources
103 java -cp $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
104 $ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
107 # Build all of the consistency specs
109 if $CHECKFLAG # CHECKFLAG
112 mkdir $BUILDDIR/specdir
113 cp $REPAIRROOT/MCC/CRuntime/* $BUILDDIR/specdir
115 echo > $BUILDDIR/specs
117 # compile specs into C code
118 for i in * # iterate over all directories
120 if [[ "$i" != "CVS" ]] # CVSDIR CHECK
123 cat $BUILDDIR/structfile.struct $i.label > $i.struct
124 java -cp $REPAIRROOT/:. MCC.Compiler -name $i -checkonly $i
125 cp size.[c,h] $BUILDDIR/specdir
126 cp $i.c $i\_aux.[c,h] $BUILDDIR/specdir
127 echo $i >> $BUILDDIR/specs
129 done # iterate over all directories
135 echo > $BUILDDIR/checkers.h
136 for i in `cat $BUILDDIR/specs`
138 gcc -O0 -g -c $i\_aux.c
139 echo \#include \"specdir\/$i\_aux.h\" >> $BUILDDIR/checkers.h
143 #build and link everything
148 INCLUDES="$INCLUDES -I$ROBUSTROOT/Runtime -I. -IRuntime/include \
151 FILES="$ROBUSTROOT/Runtime/runtime.c $ROBUSTROOT/Runtime/file.c \
152 $ROBUSTROOT/Runtime/Queue.c $ROBUSTROOT/Runtime/SimpleHash.c \
153 $ROBUSTROOT/Runtime/option.c $ROBUSTROOT/Runtime/garbage.c \
154 $ROBUSTROOT/Runtime/GenericHashtable.c"
158 EXTRAOPTIONS="$EXTRAOPTIONS -DTASK"
159 FILES="$FILES $ROBUSTROOT/Runtime/socket.c tmpbuilddirectory/taskdefs.c $ROBUSTROOT/Runtime/checkpoint.c "
164 EXTRAOPTIONS="$EXTRAOPTIONS -DCONSCHECK $BUILDDIR/specdir/*.o"
165 INCLUDES="$INCLUDES -I$BUILDDIR/specdir"
168 gcc $INCLUDES $EXTRAOPTIONS -DPRECISE_GC \
169 tmpbuilddirectory/methods.c $FILES -o $MAINFILE.bin