set -e
cd CPPToPigpioInstallDir
g++ -std=c++11 -Wall -Wextra -Werror -pthread -o CPPToPigpio.o -c dummyInstall.cc -lpigpio -lrt
ar rcs libCPPToPigpio.a CPPToPigpio.o
sudo mv libCPPToPigpio.a /usr/local/lib/
#don't forget I2C
sudo cp CPPToPigpio.h DigitalOut.h DigitalIn.h BusOut.h BusIn.h PwmOut.h I2C.h /usr/local/include/
cd -
echo "Install successful! #include <CPPToPigpio.h> and run the following to compile:" 
echo "g++ -std=c++11 -Wall -Wextra -Werror -pthread -o <output_filename> <your_main_cc> -lpigpio -lrt -lCPPToPigpio"
