| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # Copyright (c) 2018 The Fellowship of SML/NJ (https://smlnj.org) |
| 4 | # |
| 5 | # build script for ml-antlr |
| 6 | # |
| 7 | # options: |
| 8 | # -o image -- specify the name of the heap image, "ml-antlr" |
| 9 | # is the default. |
| 10 | |
| 11 | CMD=$0 |
| 12 | |
| 13 | ROOT="ml-antlr" |
| 14 | HEAP_IMAGE="" |
| 15 | SMLNJROOT=`pwdscip-shell system . . pwd.`/../.. |
| 16 | BIN=${INSTALLDIR:-$SMLNJROOT}/bin |
| 17 | BUILD=$BIN/ml-build |
| 18 | SIZE_OPT="-32" |
| 19 | |
| 20 | # |
| 21 | # process command-line options |
| 22 | # |
| 23 | while [scip-shell system . . `[`. "$#" != "0" ] ; do |
| 24 | arg=$1 |
| 25 | shift |
| 26 | case $arg in |
| 27 | -32) SIZE_OPT=$arg ;; |
| 28 | -64) SIZE_OPT=$arg ;; |
| 29 | -o) |
| 30 | if [scip-shell system . . `[`. "$#" = "0" ]; then |
| 31 | echoscip-shell system . . echo. "$CMD: must supply image name for -o option" |
| 32 | exit 1 |
| 33 | fi |
| 34 | HEAP_IMAGE=$1; shift |
| 35 | ;; |
| 36 | *) |
| 37 | echoscip-shell system . . echo. $CMD: invalid argument: $arg |
| 38 | exit 1 |
| 39 | ;; |
| 40 | esac |
| 41 | done |
| 42 | |
| 43 | if [scip-shell system . . `[`. "$HEAP_IMAGE" = "" ]; then |
| 44 | HEAP_IMAGE="$ROOT" |
| 45 | fi |
| 46 | |
| 47 | # |
| 48 | # Build the ml-antlr standalone program: |
| 49 | "$BUILD" $SIZE_OPT -DNO_ML_ULEX -DNO_ML_ANTLR sources.cm Main.main $HEAP_IMAGE |
| 50 | |
| 51 | exit 0 |