| 1234567891011121314151617181920212223 |
- #!/bin/sh
- # Build (and run) toto.mod through the V3 pipeline.
- #
- # ./M2 <session .def/.mod files> <program.mod> -> gen_ssa/<Module>.ssa
- # qbe -> gen_ssa/<Module>.s
- # cc (+ runtime shim) -> gen_ssa/<Module>
- #
- # toto.mod is `MODULE toto;` and imports TestIO, so the session is
- # TestIO.def, TestIO.mod, then the program module last.
- #
- # Usage: ./invoke.sh (from anywhere; it cd's to its own dir)
- set -e
- cd "$(dirname "$0")"
- PROG=toto # output name = module name (lowercase)
- ./M2 TestIO.def TestIO.mod toto.mod
- qbe -o "gen_ssa/$PROG.s" "gen_ssa/$PROG.ssa"
- cc "gen_ssa/$PROG.s" ../runtime/syslib/shim.c -o "gen_ssa/$PROG" -lm
- echo "--- running gen_ssa/$PROG ---"
- if "./gen_ssa/$PROG"; then rc=0; else rc=$?; fi
- echo "exit=$rc"
|