Files
mercury/tools/assemble
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

37 lines
892 B
Bash
Executable File

#!/bin/sh
# vim: ft=sh ts=4 sw=4 et
# Assemble a C source file from its component parts.
# The parts are stage2.{$base,$trial}/$testeddir/$module.c.part.{1,2,...$count}.
# Assemble uses the parts from stage2.$trial for the parts whose numbers are
# listed in $tested, and the parts from stage2.$base for the other parts.
# The patchwork file will be put in stage2/$testeddir/$module.c.
if test $# -le 5
then
echo "Usage: assemble base trial testeddir module count testedparts ..."
exit 1
fi
base="$1"
trial="$2"
testeddir="$3"
module="$4"
cnt="$5"
shift; shift; shift; shift; shift
tested="$@"
cat /dev/null > stage2/$testeddir/$module.c
i=0
while test $i -le $cnt
do
if appears $i $tested
then
which="$trial"
else
which="$base"
fi
cat stage2.$which/$testeddir/$module.c.part.$i \
>> stage2/$testeddir/$module.c
i=`expr $i + 1`
done