~kameliya/piret

ref: c6673b0e8ca8a7962f3320b23d445b6ec32ecd22 piret/strap -rwxr-xr-x 690 bytes
c6673b0e — Arlen Christian Mart Cuss docs 8 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# run the ruby compiler to make boot1
ruby piretc.rb piretc.pi > boot1.c
gcc -std=gnu99 boot1.c -g -o boot1 || (echo 'failed boot1'; exit 1) || exit 1

# run the piret compiler (boot1) to make boot2
./boot1 piretc.pi > boot2.c
gcc -std=gnu99 boot2.c -g -o boot2 || (echo 'failed boot2'; exit 1) || exit 1

# run the piret complier (boot2) to make boot3
./boot2 piretc.pi > boot3.c
gcc -std=gnu99 boot3.c -g -o boot3 || (echo 'failed boot3'; exit 1) || exit 1

# boot2 and boot3 are both from piret, so they should be identical.
if [ x"`diff boot2.c boot3.c`" != x ]; then
	echo "boot2.c and boot3.c differ (failure)"
else
	echo "boot2.c and boot3.c are identical (success)"
fi