Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (42 sloc) 1.09 KB
#!/bin/sh
set -ve
# Build script. I tried writing a Makefile, but it was longer and harder to debug.
# Maybe I was doing it wrong.
compile () {
if ! ./tinyboot.py tinyboot1.tbf1 < "$1.tbf1" > "$1"; then
cat "$1"
exit 1
fi
chmod 755 "$1"
}
if ! ./tinyboot.py hello42.tbf1 > hello42; then cat hello42; exit 1; fi
chmod 755 hello42
./hello42 || echo $?
./tinyboot.py Q.tbf1
compile Q
strace ./Q
./tinyboot.py hi.tbf1
compile hi
strace ./hi
echo x | ./tinyboot.py cat1.tbf1
compile cat1
echo x | strace ./cat1
if ! ./tinyboot.py cat.tbf1 < cat.tbf1 > tmp.out ; then cat tmp.out; exit 1; fi
cmp cat.tbf1 tmp.out
compile cat
./cat < cat.tbf1 > tmp.out
cmp cat.tbf1 tmp.out
./cat < tinyboot1.tbf1 > tmp.out # larger files sometimes show problems
cmp tinyboot1.tbf1 tmp.out
rm tmp.out
echo passamaquoddy | ./tinyboot.py star.tbf1
compile star
echo passamaquoddy | strace ./star
compile tinyboot1
time ./tinyboot1 < tinyboot1.tbf1 > tb2
cmp tinyboot1 tb2
chmod 755 tb2
./trim.py -i < tinyboot1.tbf1 > trimmed.tbf1
time ./tinyboot1 < trimmed.tbf1 > trimmed
cmp tb2 trimmed
wc trimmed.tbf1