This makefile is not properly creating the .so file. How do I write a makefile that works with all my dependencies. The dependencies: The driver file is PumaDriver.cpp and it includes PumaDriver.h. PumaDriver.h also includes PumaBody.h. PumaBody.cpp includes PumaBody.h. PumaBody.h includes PumaMotor.h. PumaMotor.cpp includes PumaMotor.h. PumaMotor.h includes serialPort.h, base_manipulation.h, silvermax_commands.h. serialPort.cpp includes serialPort.h. base_manipulation.cpp includes base_manipulation.h.
apart from that the makefile will have flags for include paths, library paths.
now to create a shared library you will use -fPIC option during compilation and -fPIC and -shared option during linking(when you make your main binary).