summaryrefslogtreecommitdiffstats
path: root/bit/build.sh
blob: 947618c1edcd8808b2b3b5fac1c739b07cd9f0fd (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
34
35
36
#!/bin/bash
# Rebuild all FPGA bit files

srcdir="./src"
bindir="."

for src in $srcdir/*; do
	[ -d "$src" ] || continue

	srcname="$(basename $src)"
	logfile="$bindir/$srcname.build.log"

	echo "Building $srcname..."
	make -C $src/ clean >/dev/null
	if [ $? -ne 0 ]; then
		echo "FAILED to clean $srcname."
		exit 1
	fi
	make -C $src/ all >$logfile
	if [ $? -ne 0 ]; then
		cat $logfile
		echo "FAILED to build $srcname."
		exit 1
	fi
	cat $logfile | grep WARNING
	cp -f $src/$srcname.bit $bindir/$srcname.bit
	make -C $src/ clean >/dev/null
	if [ $? -ne 0 ]; then
		echo "FAILED to clean $srcname."
		exit 1
	fi
	rm -f $logfile
done
echo "Successfully built all images."

exit 0
bues.ch cgit interface