home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
pub
/
users
/
Harry
/
compilers
/
yapp
/
pc
< prev
next >
Wrap
Text File
|
2003-05-23
|
676b
|
40 lines
#!/bin/sh
#
# Compile the pcat program, but do not run it.
#
# Remove any previous files to prevent confusion.
#
echo "rm -f $1.s"
rm -f $1.s
echo "rm -f $1"
rm -f $1
#
# Run the compiler, producing a .s file.
#
echo "java -cp Main.jar Main < $1.pcat 1> $1.s"
java -cp Main.jar Main < $1.pcat 1> $1.s
stat=$?
#
# Abort if the compiler ended with an error exit().
#
if test "$stat" != 0
then
echo "PCAT compiler script aborting..."
exit 1
fi
#
# Assemble the .s file, and abort if problems.
#
echo "Assembling..."
gcc -g $1.s -o $1
if test $? != 0
then
echo "PCAT compiler script aborting..."
exit 1
fi
#
# Remove the .s file
#
echo "rm -f $1.s"
rm -f $1.s