mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 21:03:53 +00:00
Estimated hours taken: 0.1 tools/assemble: Replace `shift 3' with `shift; shift; shift', since the former doesn't work on ULTRIX.
33 lines
762 B
Bash
Executable File
33 lines
762 B
Bash
Executable File
#!/bin/sh
|
|
# Assemble a C source file from its component parts.
|
|
# The parts are in stage2.{ok,bad}/$problemdir/$module.c.part.{1,2,...$count}.
|
|
# Assemble uses the parts from stage2.bad for the parts whose numbers are
|
|
# listed in $tested, and the parts from stage2.ok for the other parts.
|
|
# The patchwork file will be put in stage2/$problemdir/$module.c.
|
|
|
|
if test $# -le 3
|
|
then
|
|
echo "Usage: assemble problemdir module count testedparts ..."
|
|
exit 1
|
|
fi
|
|
|
|
problemdir="$1"
|
|
module="$2"
|
|
cnt="$3"
|
|
shift; shift; shift
|
|
tested="$@"
|
|
|
|
cat /dev/null > stage2/$problemdir/$module.c
|
|
i=0
|
|
while test $i -le $cnt
|
|
do
|
|
if appears $i $tested
|
|
then
|
|
which=bad
|
|
else
|
|
which=ok
|
|
fi
|
|
cat stage2.$which/$problemdir/$module.c.part.$i >> stage2/$problemdir/$module.c
|
|
i=`expr $i + 1`
|
|
done
|