2020-07-21 19:12:39 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
usage() {
|
2020-07-21 20:10:06 -04:00
|
|
|
echo Usage: $0 '[run|build|watch|clean]'
|
2020-07-21 19:12:39 -04:00
|
|
|
}
|
|
|
|
|
2020-07-21 20:10:06 -04:00
|
|
|
if ! command -v tup >/dev/null; then
|
|
|
|
echo Error: You need tup installed: http://gittup.org/tup/ >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-07-21 19:12:39 -04:00
|
|
|
case $1 in
|
|
|
|
run)
|
|
|
|
$0 build >&2 || exit 1
|
|
|
|
echo '' >&2 && ./Main
|
|
|
|
;;
|
2020-07-21 20:10:06 -04:00
|
|
|
watch)
|
|
|
|
tup monitor -f -a -j2 >&2
|
|
|
|
;;
|
2020-07-21 19:12:39 -04:00
|
|
|
build)
|
|
|
|
tup init 2>/dev/null
|
|
|
|
tup >&2
|
|
|
|
;;
|
|
|
|
clean)
|
|
|
|
rm -f Main *.o *.hi IRC/*.o IRC/*.hi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|