#! /bin/bash # Checks to make sure that the program passes all tests and is ready to go; # It then creates the file $OUTPUT.tar.bz2 for transfer to submit. OUTPUT=proj2-final # First, run all tests to make sure that the program works if ! ./full-test then echo ERROR: The program did not pass all validity tests. exit -1 fi # Check for any TODOs left in the source files if grep -ni TODO delay_main.c delay.h delay.c then echo "ERROR: There are apparently some unresolved TODOs (see above)" exit -1 fi # Next, create the output directory mkdir $OUTPUT # Assemble a final output file for submission cat delay_main.c - delay.c < $OUTPUT/delay.c EOF cp delay.h REPORT.txt $OUTPUT/ # Make sure the output file compiles if ! gcc -Wall -Werror $OUTPUT/delay.c -o $OUTPUT/proj2 then echo ERROR: Something is horribly wrong; the combined file did not compile! exit -1 fi rm $OUTPUT/proj2 echo Creating $OUTPUT.tar.bz2 tar -c $OUTPUT/ | bzip2 -c > $OUTPUT.tar.bz2