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 / go2 < prev    next >
Text File  |  2006-03-01  |  1KB  |  55 lines

  1. #!/bin/sh
  2. #
  3. # This script does the following:
  4. #
  5. #     Print out the PCAT source file.
  6. #     Run the compiler, producing a .s file.
  7. #     Print out the .s file.
  8. #     Assemble the .s file, and abort if problems.
  9. #     Run the executable code.
  10. #
  11. #
  12. # Print out the PCAT source file.
  13. #
  14. echo  --------------- tst/$1.pcat... ---------------
  15. cat -n < tst/$1.pcat | more
  16. #
  17. # Remove any previous .s files to prevent confusion.
  18. #
  19. echo  --------------- Removing tst/$1.s... ---------------
  20. rm -f tst/$1.s
  21. #
  22. # Run the compiler, producing a .s file.
  23. #
  24. echo  --------------- Compiling... ---------------
  25. java Main < tst/$1.pcat 1> tst/$1.s
  26. stat=$?
  27. #
  28. # Print out the .s file.
  29. #
  30. echo  --------------- tst/$1.s... ---------------
  31. cat -n < tst/$1.s | more
  32. #
  33. # Abort if the compiler ended with an error exit().
  34. #
  35. if test "$stat" != 0
  36.   then
  37.     echo "PCAT compiler script aborting..."
  38.     exit 1
  39. fi
  40. #
  41. # Assemble the .s file, and abort if problems.
  42. #
  43. echo  --------------- Assembling... ---------------
  44. gcc -g tst/$1.s -o tst/$1
  45. if test $? != 0
  46.   then
  47.     echo "PCAT compiler script aborting..."
  48.     exit 1
  49. fi
  50. #
  51. # Run the executable code.
  52. #
  53. echo  --------------- Beginning execution... ---------------
  54. tst/$1
  55.