build_test.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #
  2. ############################################
  3. # Builds the Test folder (Pascal compiler generated from pascal.atg).
  4. # Requires GNU Modula-2 (gm2) and the CR binary.
  5. ############################################
  6. echo "Building Pascal compiler (Test folder) with GNU Modula-2"
  7. cd "$(dirname "$0")/Test" || exit 1
  8. #
  9. echo "Regenerating PascalS / PascalP / Pascal from pascal.atg"
  10. CRFRAMES="$(pwd)" ../CR -m -C pascal.atg
  11. #
  12. echo "Deleting all o files"
  13. rm -f ./*.o
  14. #
  15. echo "compiling the needed modules"
  16. gm2 -fiso -c FileIO.mod
  17. gm2 -fiso -c PascalS.mod
  18. gm2 -fiso -c PascalP.mod
  19. gm2 -fiso -c Pascal.mod
  20. echo "++++++++Modules compiled ++++++++++++++++++++++"
  21. #
  22. echo "Phase 1: generating the module list"
  23. gm2 -fiso -fgen-module-list=modules.lst -o /dev/null \
  24. PascalS.o PascalP.o FileIO.o Pascal.mod
  25. #
  26. echo "Phase 2: compiling main module and linking using the module list"
  27. gm2 -fiso -fuse-list=modules.lst -o Pascal \
  28. PascalS.o PascalP.o FileIO.o Pascal.mod
  29. echo "++++++++Pascal compiler built++++++++++++++++++++++"