set -eu
camellia_path_check

fetch() {
	git clone https://github.com/Gottox/sltar
	cd sltar
	git -c advice.detachedHead=false checkout 8b5dae8e7f39401255176f806358dd04453d7831
}

prep() {
	[ -d sltar ] || (fetch)
	cd sltar
}

case $1 in
	install) (prep; make CC=x86_64-camellia-gcc "INCS=" "LIBS=" && make install "PREFIX=$PREFIX") ;;
	clean)   (prep; make clean) ;;
	*)       echo "usage: $0 install|clean"; false ;;
esac