| 1234567891011121314151617181920212223242526272829303132 |
- #!/bin/sh
- #
- # Builds the M2c compiler (step 2: scalars + MC64 backend).
- # Requires GNU Modula-2 (gm2) and the Coco/R CR binary.
- #
- # Usage: ./build.sh (from the m2c directory)
- #
- # Pipeline: M2c.atg -> M2cS/M2cP/M2c (.mod) -> gm2 -fiso -> ./M2c
- #
- CRBIN="${CRBIN:-/home/eric/Projets/Projets-Modula2/MyWork/CocoGm2/CR}"
- echo "=== Regenerating M2cS / M2cP / M2c from M2c.atg ==="
- CRFRAMES="$(pwd)" "$CRBIN" -m -C M2c.atg || exit 1
- echo "=== Deleting all o files ==="
- rm -f ./*.o
- echo "=== Compiling the needed modules ==="
- for m in FileIO SymTab MGen M2cS M2cP M2c; do
- gm2 -fiso -c "$m.mod" || exit 1
- done
- echo "=== Phase 1: generating the module list ==="
- gm2 -fiso -fgen-module-list=modules.lst -o /dev/null \
- M2cS.o M2cP.o FileIO.o SymTab.o MGen.o M2c.mod || exit 1
- echo "=== Phase 2: compiling main module and linking using the module list ==="
- gm2 -fiso -fuse-list=modules.lst -o M2c \
- M2cS.o M2cP.o FileIO.o SymTab.o MGen.o M2c.mod || exit 1
- echo "=== M2c built ==="
|