CC = gcc LIB_TARGET=libdigital.so.0.0.1 INCLUDE_FILES=digital.h all: $(LIB_TARGET) $(LIB_TARGET): digital.o $(CC) -shared -O2 -s -Wl,-soname,libdigital.so -o $(LIB_TARGET) digital.o rm -f libdigital.so ln -s $(LIB_TARGET) libdigital.so digital.o: digital.c $(CC) -c -O2 -s -fPIC digital.c clean: rm -rf *.o *.so.* *.so *.pyc install: $(LIB_TARGET) (cd /usr/local/include; rm -f $(INCLUDE_FILES)) install --mode=644 --owner=root --group=root $(INCLUDE_FILES) /usr/local/include rm -f /usr/local/lib/$(LIB_TARGET) /usr/local/lib/libdigital.so install --mode=644 --owner=root --group=root $(LIB_TARGET) /usr/local/lib ldconfig