Description:
fix for -o option for fpc-2.0.0 git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@226 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r54:a67009b340d8 - - 1 file changed: 2 inserted, 1 deleted

@@ -43,64 +43,65
43 43 talk "programming language: ${PROG_LANG}"
44 44 fi
45 45
46 46 if [ $# -ge 2 ]
47 47 then
48 48 export SOURCE_FILE=$2
49 49 else
50 50 export SOURCE_FILE=source
51 51 fi
52 52 talk " source file: $SOURCE_FILE"
53 53
54 54 if [ $# -ge 3 ]
55 55 then
56 56 export OUTPUT_FILE=$3
57 57 else
58 58 export OUTPUT_FILE=a.out
59 59 fi
60 60 talk " output file: $OUTPUT_FILE"
61 61
62 62 if [ $# -eq 4 ]
63 63 then
64 64 export MESSAGE_FILE=$4
65 65 else
66 66 export MESSAGE_FILE=compiler_message
67 67 fi
68 68 talk " message file: $MESSAGE_FILE"
69 69
70 70 # Remove any remaining output files or message files.
71 71 rm -Rf $OUTPUT_FILE
72 72 rm -Rf $MESSAGE_FILE
73 73
74 74 # Check if the source file exists before attempt compiling.
75 75 if [ ! -f $SOURCE_FILE ]
76 76 then
77 77 talk "ERROR: The source file does not exist!"
78 78 echo "ERROR: The source file did not exist." > $MESSAGE_FILE
79 79 exit 127
80 80 fi
81 81
82 82 # Compile.
83 83 if [ $PROG_LANG = "c" ]
84 84 then
85 85 $C_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $C_OPTIONS 2>$MESSAGE_FILE
86 86 elif [ $PROG_LANG = "c++" ]
87 87 then
88 88 $CPLUSPLUS_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $CPLUSPLUS_OPTIONS 2>$MESSAGE_FILE
89 89 elif [ $PROG_LANG = "pas" ]
90 90 then
91 - $PASCAL_COMPILER $SOURCE_FILE -o$OUTPUT_FILE $PASCAL_OPTIONS >$MESSAGE_FILE
91 + $PASCAL_COMPILER $SOURCE_FILE -ooutpas $PASCAL_OPTIONS >$MESSAGE_FILE
92 + mv outpas $OUTPUT_FILE
92 93 else
93 94 talk "ERROR: Invalid language specified!"
94 95 echo "ERROR: Invalid language specified!" > $MESSAGE_FILE
95 96 exit 127
96 97 fi
97 98
98 99 # Report success or failure.
99 100 if [ -f $OUTPUT_FILE ]
100 101 then
101 102 talk "Compilation was successful!"
102 103 else
103 104 talk "ERROR: Something was wrong during the compilation!"
104 105 talk "Dumping compiler message:"
105 106 #cat $MESSAGE_FILE
106 107 fi
You need to be logged in to leave comments. Login now