mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 06:14:59 +00:00
Estimated hours taken: 2 Rename `mc' as `mmc'. Note: we do not change the names of variables such as MCFLAGS, just the `mc' executable. configure.in: Look for mmc not mc. If you can't find mmc to bootstrap, try for mc. bindist/Mmakefile: bindist/bindist.configure.in: doc/Mmakefile: doc/user_guide.texi: scripts/Mmake.vars.in: scripts/Mmakefile: scripts/msl.in: tools/expand_params: tools/optstages: tools/speedtest: tools/test_mercury: Change references to mc into mmc.
92 lines
1.8 KiB
Bash
Executable File
92 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# The objective of this script is to transform a shorthand description
|
|
# of an Mmake.params file into the Mmake.params itself. The shorthand
|
|
# description is given to this script as its arguments.
|
|
#
|
|
# The shorthand consists of pairs of word:
|
|
#
|
|
# grade <full grade name> meaning that grade
|
|
# args {s,c} meaning simple or compact
|
|
# typeinfo {1,2,s,d} meaning one-cell, one-or-two-cell,
|
|
# shared-one-or-two-cell, or default
|
|
# opt <integer> meaning that optimization level
|
|
#
|
|
# Other arguments are also allowed; these are expected to be other arguments
|
|
# to mmc.
|
|
|
|
usage="$0 [grade g] [args {s,c}] [typeinfo {1,2,s,d}] [opt N] mcflags ..."
|
|
|
|
GRADE="asm_fast.gc"
|
|
MCFLAGS=""
|
|
CFLAGS=""
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
|
|
grade)
|
|
GRADE="$2"
|
|
shift
|
|
shift
|
|
;;
|
|
|
|
args)
|
|
if test "$2" = s
|
|
then
|
|
MCFLAGS="$MCFLAGS --args simple"
|
|
elif test "$2" = c
|
|
then
|
|
MCFLAGS="$MCFLAGS --args compact"
|
|
CFLAGS="$CFLAGS -DCOMPACT_ARGS"
|
|
else
|
|
echo $usage ; exit 1
|
|
fi
|
|
shift
|
|
shift
|
|
;;
|
|
|
|
typeinfo)
|
|
if test "$2" = 1
|
|
then
|
|
MCFLAGS="$MCFLAGS --type-info one-cell"
|
|
CFLAGS="$CFLAGS -DONE_CELL_TYPEINFO"
|
|
elif test "$2" = 2
|
|
then
|
|
MCFLAGS="$MCFLAGS --type-info one-or-two-cell"
|
|
CFLAGS="$CFLAGS -DONE_OR_TWO_CELL_TYPEINFO"
|
|
elif test "$2" = s
|
|
then
|
|
MCFLAGS="$MCFLAGS --type-info shared-one-or-two-cell"
|
|
CFLAGS="$CFLAGS -DSHARED_ONE_OR_TWO_CELL_TYPEINFO"
|
|
elif test "$2" = d
|
|
then
|
|
MCFLAGS="$MCFLAGS --type-info default"
|
|
CFLAGS="$CFLAGS -DDEFAULT_TYPEINFO"
|
|
else
|
|
echo $usage ; exit 1
|
|
fi
|
|
shift
|
|
shift
|
|
;;
|
|
|
|
opt)
|
|
MCFLAGS="$MCFLAGS -O$2"
|
|
shift
|
|
shift
|
|
;;
|
|
|
|
*)
|
|
MCFLAGS="$MCFLAGS $1"
|
|
shift
|
|
;;
|
|
|
|
esac
|
|
done
|
|
|
|
echo "MC = ../scripts/mmc"
|
|
echo "GRADE = $GRADE"
|
|
echo "MCFLAGS = $MCFLAGS"
|
|
echo "EXTRA_CFLAGS = $CFLAGS"
|
|
echo "EXTRA_MLFLAGS = -g"
|
|
exit 0
|