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 / p11 / pc < prev    next >
Text File  |  2006-03-01  |  652b  |  40 lines

  1. #!/bin/sh
  2. #
  3. # Compile the pcat program and run it.
  4. #
  5. # Remove any previous files to prevent confusion.
  6. #
  7. echo "rm -f $1.s"
  8. rm -f $1.s
  9. echo "rm -f $1"
  10. rm -f $1
  11. #
  12. # Run the compiler, producing a .s file.
  13. #
  14. echo "java Main < $1.pcat 1> $1.s"
  15. java Main < $1.pcat 1> $1.s
  16. stat=$?
  17. #
  18. # Abort if the compiler ended with an error exit().
  19. #
  20. if test "$stat" != 0
  21.   then
  22.     echo "PCAT compiler script aborting..."
  23.     exit 1
  24. fi
  25. #
  26. # Assemble the .s file, and abort if problems.
  27. #
  28. echo "Assembling..."
  29. gcc -g $1.s -o $1
  30. if test $? != 0
  31.   then
  32.     echo "PCAT compiler script aborting..."
  33.     exit 1
  34. fi
  35. #
  36. # Run the executable code.
  37. #
  38. echo "Beginning execution..."
  39. $1
  40.