I am experimenting with how to distribute a simple graphics library for Linux using a
Makefile. The shared library is called
libsgtk.so. Here is my first attempt for the
CFLAGS= -pthread \ -I/usr/include/gtk-3.0 \ -I/usr/include/pango-1.0 \ -I/usr/include/atk-1.0 \ -I/usr/include/cairo \ -I/usr/include/gdk-pixbuf-2.0 \ -I/usr/include/glib-2.0 \ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include all: libsgtk.so libsgtk.so: window.o gcc -shared -o libsgtk.so window.o window.o: window.c gcc $(CFLAGS) -c -fpic window.c clean: rm window.o install: mv libsgtk.so /usr/local/lib
As you can see, I have hard coded the installation path to
/usr/local/lib. Is this a recommended approach?
What should I do if a library with the same name already exists in that path?
Should this be checked in the Makefile, or is there some other tools that I should use that could provide me with an alternative installation path?