# 1. check if the directory "bin" exists, mkdir if not
# 2. check if the directory "obj" exists, mkdir if not
# 3. check if doxygen is installed,
# 3a. if it does, then create the doxyfile for it
# 3b. if not, then skip it and tell the user


echo -n directory \"bin\"... 
if [ ! -d "bin" ]; then
	mkdir bin
	echo created
else
	echo exist
fi


echo -n directory \"obj\"... 
if [ ! -d "obj" ]; then
	mkdir obj
	echo created
else
	echo exist
fi


if ! command -v doxygen &> /dev/null
then
	echo doxygen not installed, skipping
else
	echo -n doxygen was found, checking doxyfile...
	if [ ! -f doxyfile ]; then
		doxygen -g doxyfile 1>/dev/null
		echo "INPUT = src" >> doxyfile
		echo "OUTPUT_DIRECTORY = doc" >> doxyfile
		echo "GENERATE_LATEX = NO" >> doxyfile
		echo "PROJECT_NAME = \"${PWD##*/}\"" >> doxyfile
		echo created
	else
		echo found
	fi

fi






