#############################
#check whether to enable gpu#
#############################
# to enable gpu, please add -enable-gpu when run this command
if [ "$1" == "-enable-gpu" ]; then
	echo GPU compilation is enabled. Please make sure nvcc is installed in your PC.
	echo enableGPU=true >makefile.pa
else
	echo GPU compilation is disabled.
	echo enableGPU=false >makefile.pa
fi

###############
#detect system#
###############
#!/usr/bin/env bash
OSTYPE=linux
if [ "$(uname)" == "Darwin" ]; then
    # Do something under Mac OS X platform        
    OSTYPE=darwin	
    echo Operation System is Mac OS
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
    # Do something under GNU/Linux platform
    OSTYPE=linux
    echo Operation System is GNU/Linux
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
    # Do something under Windows NT platform
    echo Operation System is Windows NT
    OSTYPE=cygwin
fi

#If the detection is not correct, you may manually correct it by uncomment the corresponding line below.
#OSTYPE=linux
#OSTYPE=darwin
#OSTYPE=cygwin

############
#build cudd#
############
HOME_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd cudd
if [ "$OSTYPE" == "linux" ]; then
	./configure --enable-shared
else
	./configure
fi 
make
