summaryrefslogtreecommitdiff
path: root/miniany/autobuild.sh
blob: 8de5629b6e9d7d3dcf38581d38490c4f4b98ed15 (plain)
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
#!/bin/bash

cat >/tmp/autobuild_tmp_$$.sh <<EOF
#!/bin/bash -x

echo "---"
./build.sh cc tcc hosted d
if test \$? -eq 0; then
	./cc < test1.c > test1.asm
	if test \$? -eq 0; then
		fasm test1.asm test1.bin
		if test \$? -eq 0; then
			../ecomp-c/emul -v test1.bin
			if test \$? -ne 0; then
				echo "ERROR: running emulator with test1.bin"
			fi
		else
			echo "ERROR: assembling test1.asm"
		fi
	else
		echo "ERROR: compiling test1.c"
		grep '; ERROR' test1.asm
	fi
else
	echo "ERROR: building cc"
fi
EOF
chmod 775 /tmp/autobuild_tmp_$$.sh

ls cc.c c4.c ../ecomp-c/emul.c ../ecomp-c/asm-i386.c test1.c | \
	entr bash /tmp/autobuild_tmp_$$.sh
rm -f /tmp/autobuild_tmp_$$.sh