#!/bin/sh
if [[ $1 == "install" ]]; then
	if [[ `whoami` == "root" ]]; then
		if [[ $2 == "" ]]; then
			cp -r ./include/LEXSDL /usr/include/
			cp ./lib/liblexsdl.a /usr/lib/
			cp ./lib32/liblexsdl.a /usr/lib32/
			echo ""
			echo "INSTALLED LEXSDL TO /usr"
		fi
	elif [[ $2 != "" ]]; then
		cp -r ./include/LEXSDL $2/include/
		cp ./lib/liblexsdl.a $2/lib/
		cp ./lib32/liblexsdl.a $2/lib32/
		echo ""
		echo "INSTALLED LEXSDL TO $2"
	else
		echo ""
		echo -e "\033[1;31mfailed\033[0m : root priviledges required"
	fi
elif [[ $1 == "uninstall" ]]; then
	if [[ `whoami` == "root" ]]; then
		rm -rf /usr/include/LEXSDL
		rm -rf /usr/lib/liblexsdl.a
		rm -rf /usr/lib32/liblexsdl.a
		echo ""
		echo -e "\033[1;31mUNINSTALLED LEXSDL\033[0m"
	else
		echo ""
		echo -e "\033[1;31mfailed\033[0m : root priviledges required"
	fi
else
	echo ""
	echo "available options are"
	echo -e "\033[1;32minstall\033[0m | \033[1;31munintall\033[0m"
fi