Files
mercury/tools/expand_params
Zoltan Somogyi 47a1a02a92 Add vim modelines to most tools.
tools/add_cont_lines:
tools/appears:
tools/assemble:
tools/avg_frame_size:
tools/build_srcdist:
tools/cleanint:
tools/compare_frame_sizes:
tools/configure_mingw_cross:
tools/cont:
tools/ctor_rep_stats:
tools/cur_param:
tools/dd_speedtest:
tools/divide:
tools/extract_dd_stats:
tools/file_name_translation_stats:
tools/frame_sizes:
tools/gdbrun:
tools/half:
tools/info_stats.awk:
tools/linear:
tools/lmc.in:
tools/mai_stats:
tools/make_arena:
tools/next_param:
tools/not:
tools/optstages:
tools/type_ctor_stats:
    Add vim mode lines. Replace tabs with spaces.
2021-04-27 03:54:27 +10:00

93 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
# vim: ft=sh ts=4 sw=4 et
#
# 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