| 123456789101112131415161718192021222324 |
- #!/bin/sh
- # Builds M2make with GNU Modula-2 (gm2 -fiso).
- # Usage: ./build_gm2.sh (from the tools/m2make directory)
- # Output: b_gm2/M2make
- set -e
- cd "$(dirname "$0")"
- SRC=../../compiler/src
- rm -rf b_gm2
- mkdir -p b_gm2
- cp M2make.mod M2makeOS.def M2makeC.def m2make_os.c b_gm2/
- cp M2makeOS_gm2.mod b_gm2/M2makeOS.mod
- cp "$SRC/FileIO.def" "$SRC/FileIO.mod" b_gm2/
- cd b_gm2
- echo "=== Compiling (gm2) ==="
- for m in FileIO M2makeOS M2make; do
- gm2 -fiso -c "$m.mod" || exit 1
- done
- echo "=== Generating module list ==="
- gm2 -fiso -fgen-module-list=modules.lst -o /dev/null \
- FileIO.o M2makeOS.o M2make.mod m2make_os.c || exit 1
- echo "=== Linking ==="
- gm2 -fiso -fuse-list=modules.lst -o M2make \
- FileIO.o M2makeOS.o M2make.mod m2make_os.c || exit 1
- echo "=== b_gm2/M2make built ==="
|