-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild
executable file
·52 lines (43 loc) · 1.11 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/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
cc -Wall 386.c -o 386